|  | 
|  | 
| back to board | AC with this formula Posted by Sergey  9 Oct 2011 01:01I've used this formula to solve this problem:a(n) = 2^(b(n)-1) + a(n - c(1+b(n)))
 b(n) = -1+floor(log(((n+0.2)*sqrt(5)))/log((1+sqrt(5))/2));
 c(0) = 0, c(1) = 1, c(n) = c(n-1) + c(n-2)
Re: AC with this formula INSANE!Re: AC with this formula Posted by htzfun  1 May 2012 17:44I don't want to live in this world anymore.Re: AC with this formula wow!!!! you probably made an easy thing too complicated.Re: AC with this formula Looks like you're using golden ratio to calculate FibonacciRe: AC with this formula Way too complicated. I solved entirely using bitwise operations and an array with the first 64 Fibonacci numbers. | 
 | 
|