Pisano period: Difference between revisions

rewording for clarity.
(rewording for clarity.)
Line 4:
For any integer n, the Fibonacci sequence taken modulo n is periodic and the period is called the [[wp:Pisano_period|Pisano period]].
 
Letif callwe have the function pisano,(x) return the Pisanopisano period using modulo x, (e.g. pisano(2) = 3). Ifand [[wp:Least common multiple|lcm]](x, y) return the least common multiple between x and y; then if m and n are [[wp:Coprime integers|coprime]], pisano(m*n) = [[wp:Least common multiple|lcm]](pisano(m),pisano(n)).
 
Therefore calculate the Pisano period of an integer m is accomplished by calculating the Pisano periods of the prime powers in the prime decomposition of m.
Anonymous user