Skip to content

Instantly share code, notes, and snippets.

Last active May 8, 2016 17:01
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/aa63ddafa832ce361161d6909dfd0aa1 to your computer and use it in GitHub Desktop.
Save anonymous/aa63ddafa832ce361161d6909dfd0aa1 to your computer and use it in GitHub Desktop.
fn v(n: u32) -> u32 {
return match n {
n if n > 0 => 3*c(n-1),
_ => 1,
}
}
fn c(n: u32) -> u32 {
return match n {
n if n > 0 => 2*v(n-1) + 2*c(n-1),
_ => 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