Created
May 8, 2016 18:39
-
-
Save anonymous/e779072068bc5a805630014f10b70fff to your computer and use it in GitHub Desktop.
Shared via Rust Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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