Skip to content

Instantly share code, notes, and snippets.

Created May 8, 2016 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/e779072068bc5a805630014f10b70fff to your computer and use it in GitHub Desktop.
Save anonymous/e779072068bc5a805630014f10b70fff to your computer and use it in GitHub Desktop.
Shared via Rust Playground
fn v(n: u32) -> u32 {
match n {
0 => 1,
_ => 3*c(n-1),
}
}
fn c(n: u32) -> u32 {
match n {
0 => 1,
_ => 2*v(n-1) + 2*c(n-1),
}
}
fn main() {
println!("{}", 2*v(9));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment