OFFSET
1,1
COMMENTS
The Lucas numbers mod n for any n are periodic; see A106291 for period lengths.
REFERENCES
V. E. Hoggatt, Jr., Fibonacci and Lucas Numbers. Houghton, Boston, MA, 1969.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
EXAMPLE
The 5th prime number is 11. The Lucas sequence mod 11 is {2,1,3,4,7,0,7,7,3,10,2,1,3,...} - a periodic sequence. There are 7 distinct residues in this sequence, namely {0,1,2,3,4,7,10}. So a(5) = 7.
MATHEMATICA
pisano[n_] := Module[{a = {2, 1}, a0, k = 0, s}, If[n == 1, 1, a0 = a; Reap[While[k++; s = Mod[Plus @@ a, n]; Sow[s]; a[[1]] = a[[2]]; a[[2]] = s; a != a0]][[2, 1]]]]; Join[{2}, Table[u = Union[pisano[n]]; Length[u], {n, Prime[Range[2, 100]]}]] (* T. D. Noe, Mar 22 2013 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Casey Mongoven, Mar 20 2013
STATUS
approved