Pisano period: Difference between revisions

m
added whitespace.
m (added whitespace.)
Line 1:
{{draft task}}[[Category:Mathematics]]
[[Category:Mathematics]]
 
The [[wp:Fibonacci_Number|Fibonacci sequence]] taken modulo 2 is a periodic sequence of period 3 : 0, 1, 1, 0, 1, 1, ...
 
Line 6 ⟶ 8:
Prime numbers are straightforward; the Pisano period of a prime number '''p''' is simply: '''pisano(p)'''. The Pisano period of a composite number '''c''' may be found in different ways. It may be calculated directly: '''pisano(c)''', which works, but may be time consuming to find, especially for larger integers, or, it may be calculated by finding the [[wp:Least common multiple|least common multiple]] of the Pisano periods of each composite component.
 
 
E.G. Given a Pisano period function: pisano(x), and a least common multiple function lcm(x, y):
;E.G.:
E.G. Given a Pisano period function: pisano(x), and a least common multiple function lcm(x, y):
 
'''pisano(m × n)''' is equivalent to '''lcm(pisano(m), pisano(n))''' where '''m''' and '''n''' are '''[[wp:Coprime|coprime]]'''
Line 17 ⟶ 21:
The equation is conjectured, no exceptions have been seen.
 
If a positive integer  '''i'''  is split into its prime factors then the second and first equations above can be applied to generate the pisano period.
 
 
;Task
Line 31 ⟶ 36:
 
Print pisano(m) for every integer from 1 to 180.
 
;Related tasks
Line 36 ⟶ 42:
*  [[Prime decomposition]]
*  [[Least common multiple]]
<br><br>
 
=={{header|Factor}}==