← Discussion

some guidance !!

Azure · 2014-01-20 02:40:03

hey guys can u give me some guidance to solve this problem ??

BECCA · 2014-01-22 23:51:43

Hello

You don't need any "Bignum" things in this problem.

1) Add The input by 2;

2) if the remainder from the division of 4 gave you 0 print YES else print NO!

For example:

1: (1 + 2) mod 4 <> 0 So your answer should be no.

4: (4 + 2) mod 4 <> 0 So your answer should be no again.

2: (2 + 2) mod 4 = 0 So your answer should be yes!

Azure · 2014-01-25 20:38:53

thanks BECCA ;) but what's the reason????

BECCA · 2014-02-02 21:44:10

Sorry for the late replie.

The answer is simple. Since (7,11) = (7,7) + (0,4), your sequence is F(n)=4Fibonacci(n)+7Fibonacci(n+1).

pages:
  • 1