cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A137750 Number of distinct residues in the Fibonacci sequence mod the n-th prime.

Original entry on oeis.org

2, 3, 5, 7, 7, 9, 13, 12, 19, 10, 19, 29, 19, 33, 15, 37, 37, 25, 51, 44, 57, 49, 63, 17, 69, 35, 79, 33, 49, 33, 97, 82, 109, 33, 61, 37, 113, 123, 127, 137, 112, 62, 119, 149, 149, 16, 30, 169, 171, 80, 21, 149, 103, 157, 193, 85
Offset: 1

Views

Author

Casey Mongoven, Feb 10 2008

Keywords

Examples

			The 5th prime number is 11. The Fibonacci sequence mod 11 is {0,1,1,2,3,5,8,2,10,1,0,1,...} - a periodic sequence. There are 7 distinct residues in this sequence, namely {0,1,2,3,5,8,10}. So a(5) = 7.
		

Crossrefs

Programs

  • Mathematica
    With[{f=Fibonacci[Range[500]]},Table[Length[Union[Mod[f,Prime[n]]]],{n,60}]] (* Harvey P. Dale, Aug 15 2012 *)
  • PARI
    a(n)=my(v=List([0,1]),p=prime(n));while(v[#v]||v[#v-1]!=1, listput(v,(v[#v]+v[#v-1])%p));#vecsort(Vec(v),,8) \\ Charles R Greathouse IV, Apr 24 2012

Formula

a(n) = A066853(A000040(n)). - Max Alekseyev, Feb 08 2023

A223489 a(n) = number of missing residues in the Lucas sequence mod the n-th prime number.

Original entry on oeis.org

0, 0, 1, 0, 4, 1, 1, 7, 4, 19, 12, 9, 22, 10, 32, 9, 22, 33, 16, 27, 17, 30, 20, 65, 17, 66, 24, 74, 61, 73, 30, 49, 37, 106, 77, 114, 33, 40, 40, 49, 67, 119, 72, 49, 49, 183, 181, 54, 56, 149, 205, 90, 138, 94, 61, 178, 149, 102, 73, 254, 70, 81, 264, 117, 69
Offset: 1

Views

Author

Casey Mongoven, Mar 20 2013

Keywords

Comments

The Lucas numbers mod n for any n are periodic - see A106291 for period lengths.

Examples

			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 4 residues which do not occur in this sequence, namely {5,6,8,9}. So a(5) = 4.
		

References

  • V. E. Hoggatt, Jr., Fibonacci and Lucas Numbers. Houghton, Boston, MA, 1969.

Crossrefs

Cf. A137751.

Programs

  • 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]]; mx = Max[u]; Length[Complement[Range[0,mx], u]], {n, Prime[Range[2, 100]]}]] (* T. D. Noe, Mar 22 2013 *)
Showing 1-2 of 2 results.