2021.10.18 MATH 3600 Pisano period for prime powers

51 days ago by calkin

def F(n,m): return(mod(fibonacci(n),m)) def pisano(m): i=1 while (F(i,m)==0 and F(i+1,m)==1)==False: i+=1 return(i) 
       
[[i,pisano(2^i)] for i in srange(1,11)] 
       
[[1, 3],
 [2, 6],
 [3, 12],
 [4, 24],
 [5, 48],
 [6, 96],
 [7, 192],
 [8, 384],
 [9, 768],
 [10, 1536]]
[[1, 3],
 [2, 6],
 [3, 12],
 [4, 24],
 [5, 48],
 [6, 96],
 [7, 192],
 [8, 384],
 [9, 768],
 [10, 1536]]
F(3*2^18,2^20) 
       
0
0
F(3*2^18+1, 2^20) 
       
524289
524289
F(3*2^19+1, 2^20) 
       
1
1
[[i,pisano(5^i)] for i in srange(1,6)] 
       
[[1, 20], [2, 100], [3, 500], [4, 2500], [5, 12500]]
[[1, 20], [2, 100], [3, 500], [4, 2500], [5, 12500]]
[[i,4*5^i] for i in srange(1,6)] 
       
[[1, 20], [2, 100], [3, 500], [4, 2500], [5, 12500]]
[[1, 20], [2, 100], [3, 500], [4, 2500], [5, 12500]]
F(4*5^20,5^20)