How can i calculate the smallest Fibonacci number that can be divided by $2^m$ (a big number). I tried computing with a dynamic algorithm but it reaches a point where my RAM simply can't carry on. Any ideas?
The smallest Fibonacci number that can be divided by $2^m$
313 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 3 best solutions below
On
The Fibonacci numbers, mod $2^m$, are periodic, with period less than $2^{m+1}$. Further, the period begins with $0,1$. For a proof, see here.
Hence, once they begin to repeat, you will get a Fibonacci number with $2^m$ as divisor. You can do all computations modulo $2^m$, which hopefully won't overtax your RAM.
On
You can do all of your calculations mod $2^n$ to start. For example, if you wanted to find the smallest n such that $2^m | F_n$ with m = 2 you can keep track of the remainder of $F_i$ and $F_{i+1}$ mod 4. This would proceed like so:
$$F_1 = 1 \,mod\, 4$$ $$F_2 = 1 \,mod\, 4$$ $$F_3 = 2 \,mod\, 4$$ $$F_4 = 3 \,mod\, 4$$ $$F_5 = 1 \,mod\, 4$$ $$F_6 = 0 \,mod\, 4$$
And you could then conclude that $F_6$ is the smallest Fibonacci divisible by $2^2$ and then use an alternate method to calculate the value of $F_6$. The advantage of this method is that you only need to keep track of two numbers of m bits which represent the last two remainders. Adding these two remainders is very straightforward as well and should not burden your computer too much.
Your should look at this summary The Fibonacci Sequence Modulo m by Marc Renault.
It contains a lot of information about divisibility properties of Fibonacci sequences.
According to section D. "Facts on the rank of $F \pmod m$" on above summary,
Look at there for related results and references.