OFFSET
1,2
COMMENTS
144 appears to be the most common perfect square.
LINKS
Robert Israel, Table of n, a(n) for n = 1..5173
EXAMPLE
Let P(n) be the period length of the modulo n Fibonacci sequence (also called the Pisano period). Then {P(n)}=1,3,8,6,20,24,16,12,... and a(2)=7 because the second perfect square in {P(n)} occurs when n=7.
MAPLE
pisano:= proc(n) option remember; local f, F, k;
F:= ifactors(n)[2];
if nops(F)<>1 then ilcm(seq(procname(k[1]^k[2]), k=F))
else
f:= [0, 1];
for k from 1 do f:=[f[2], f[1]+f[2] mod n];
if f=[0, 1] then return k fi
od;
fi
end:
select(t -> issqr(pisano(t)), [$1..1000]); # Robert Israel, Jun 13 2025
MATHEMATICA
t = {1}; Do[a = {1, 0}; a0 = a; k = 0; While[k++; s = Mod[Plus @@ a, n]; a = RotateLeft[a]; a[[2]] = s; a != a0]; If[IntegerQ[Sqrt[k]], AppendTo[t, n]], {n, 2, 1000}]; t (* T. D. Noe, Aug 08 2012 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
William C. Brown (wcbrow00(AT)centre.edu), Apr 18 2005
STATUS
approved
