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-8 of 8 results.

A001175 Pisano periods (or Pisano numbers): period of Fibonacci numbers mod n.

Original entry on oeis.org

1, 3, 8, 6, 20, 24, 16, 12, 24, 60, 10, 24, 28, 48, 40, 24, 36, 24, 18, 60, 16, 30, 48, 24, 100, 84, 72, 48, 14, 120, 30, 48, 40, 36, 80, 24, 76, 18, 56, 60, 40, 48, 88, 30, 120, 48, 32, 24, 112, 300, 72, 84, 108, 72, 20, 48, 72, 42, 58, 120, 60, 30, 48, 96, 140, 120, 136
Offset: 1

Views

Author

Keywords

Comments

These numbers might also have been called Fibonacci periods.
Also, number of perfect multi-Skolem type sequences of order n.
Index the Fibonacci numbers so that 3 is the fourth number. If the modulo base is a Fibonacci number (>=3) with an even index, the period is twice the index. If the base is a Fibonacci number (>=5) with an odd index, the period is 4 times the index. - Kerry Mitchell, Dec 11 2005
Each row of the image represents a different modulo base n, from 1 at the bottom to 24 at the top. The columns represent the Fibonacci numbers mod n, from 0 mod n at the left to 59 mod n on the right. In each cell, the brightness indicates the value of the residual, from dark for 0 to near-white for n-1. Blue squares on the left represent the first period; the number of blue squares is the Pisano number. - Kerry Mitchell, Feb 02 2013
a(n) = least positive integer k such that F(k) == 0 (mod n) and F(k+1) == 1 (mod n), where F = A000045 is the Fibonacci sequence. a(n) exists for all n by Dirichlet's box principle and the fact that the positive integers are well-ordered. Cf. Saha and Karthik (2011). - L. Edson Jeffery, Feb 12 2014

Examples

			For n=4, take the Fibonacci sequence (A000045), 1, 1, 2, 3, 5, 8, 13, 21, ... (mod 4), which gives 1, 1, 2, 3, 1, 0, 1, 1, .... This repeats a pattern of length 6, so a(4) = 6. - _Michael B. Porter_, Jul 19 2016
		

References

  • B. H. Hannon and W. L. Morris, Tables of Arithmetical Functions Related to the Fibonacci Numbers. Report ORNL-4261, Oak Ridge National Laboratory, Oak Ridge, Tennessee, Jun 1968.
  • J. Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 162.
  • J. H. Silverman, A Friendly Introduction to Number Theory, 3rd ed., Pearson Education, Inc, 2006, pp. 304 - 309.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • S. Vajda, Fibonacci and Lucas numbers and the Golden Section, Ellis Horwood Ltd., Chichester, 1989. See p. 89. - N. J. A. Sloane, Feb 20 2013

Crossrefs

Cf. A060305 (Fibonacci period mod prime(n)), A003893.
Cf. A001178 (Fibonacci frequency), A001179 (Leonardo logarithm), A235702 (fixed points), A066853 (number of elements in the set of residua), A222413, A296240 (Pisano quotients for primes).

Programs

  • Haskell
    a001175 1 = 1
    a001175 n = f 1 ps 0 where
       f 0 (1 : xs) pi = pi
       f _ (x : xs) pi = f x xs (pi + 1)
       ps = 1 : 1 : zipWith (\u v -> (u + v) `mod` n) (tail ps) ps
    -- Reinhard Zumkeller, Jan 15 2014
    
  • Maple
    a:= proc(n) local f, k, l; l:= ifactors(n)[2];
          if nops(l)<>1 then ilcm(seq(a(i[1]^i[2]), i=l))
        else f:= [0, 1];
             for k do f:=[f[2], f[1]+f[2] mod n];
                      if f=[0, 1] then break fi
             od; k
          fi
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Sep 18 2013
  • Mathematica
    Table[a={1, 0}; a0=a; k=0; While[k++; s=Mod[Plus@@a, n]; a=RotateLeft[a]; a[[2]]=s; a!=a0]; k, {n, 2, 100}] (* T. D. Noe, Jul 19 2005 *)
    a[1]=1; a[n_]:= For[k = 1, True, k++, If[Mod[Fibonacci[k], n]==0 && Mod[ Fibonacci[k+1], n]==1, Return[k]]]; Table[a[n], {n, 100}] (* Jean-François Alcover, Feb 11 2015 *)
    test[{0, 1, }]:= False; test[]:= True;
    nest[k_][{a_, b_, c_}]:= {Mod[b, k], Mod[a+b, k], c+1};
    A001175[1] := 1;
    A001175[k_]:= NestWhile[nest[k], {1, 1, 1}, test][[3]];
    Table[A001175[n], {n, 100}] (* Leo C. Stein, Nov 08 2019 *)
    Module[{nn=1000,fibs},fibs=Fibonacci[Range[nn]];Table[Length[ FindTransientRepeat[ Mod[fibs,n],2][[2]]],{n,70}]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 02 2020 *)
  • PARI
    minWSS=2^64; \\ PrimeGrid search
    fibmod(n,m)=((Mod([1,1;1,0],m))^n)[1,2]
    entryp(p)=my(k=p+[0, -1, 1, 1, -1][p%5+1], f=factor(k)); for(i=1, #f[, 1], for(j=1, f[i, 2], if((Mod([1, 1; 1, 0], p)^(k/f[i, 1]))[1, 2], break); k/=f[i, 1])); k
    entry(n)=if(n==1,return(1)); my(f=factor(n), v); v=vector(#f~, i, if(f[i,1]>=minWSS, entryp(f[i,1]^f[i,2]), entryp(f[i,1])*f[i,1]^(f[i,2] - 1))); if(f[1,1]==2&&f[1,2]>1, v[1]=3<Charles R Greathouse IV, Feb 13 2014; updated Dec 14 2016; updated Aug 24 2021; updated Jul 08 2024
    
  • Python
    from functools import reduce
    from sympy import factorint, lcm
    def A001175(n):
        if n == 1:
            return 1
        f = factorint(n)
        if len(f) > 1:
            return reduce(lcm, (A001175(a**f[a]) for a in f))
        else:
            k,x = 1, [1,1]
            while x != [0,1]:
                k += 1
                x = [x[1], (x[0]+x[1]) % n]
            return k # Chai Wah Wu, Jul 17 2019
  • Sage
    def a(n): return BinaryRecurrenceSequence(1,1).period(n) # Ralf Stephan, Jan 23 2014
    

Formula

Let the prime factorization of n be p1^e1...pk^ek. Then a(n) = lcm(a(p1^e1), ..., a(pk^ek)). - T. D. Noe, May 02 2005
a(n) = n-1 if n is a prime > 5 included in A003147 ( n = 11, 19, 31, 41, 59, 61, 71, 79, 109...). - Benoit Cloitre, Jun 04 2002
K. S. Brown shows that a(n)/n <= 6 for all n and a(n)=6n if and only if n has the form 2*5^k.
a(n) = A001177(n)*A001176(n) for n >= 1. - Henry Bottomley, Dec 19 2001
a(n) <= 2*n+2 if n is a prime > 5, by Wall's Theorems 6 and 7; see A060305, A222413, A296240. - Jonathan Sondow, Dec 10 2017
a(2^k) = 3*2^(k-1) for k > 0. In general, if a(p) != a(p^2) for p prime, then a(p^k) = p^(k-1)*a(p) [Wall, 1960]. - Chai Wah Wu, Feb 25 2022

A001583 Artiads: the primes p == 1 (mod 5) for which Fibonacci((p-1)/5) is divisible by p.

Original entry on oeis.org

211, 281, 421, 461, 521, 691, 881, 991, 1031, 1151, 1511, 1601, 1871, 1951, 2221, 2591, 3001, 3251, 3571, 3851, 4021, 4391, 4441, 4481, 4621, 4651, 4691, 4751, 4871, 5081, 5281, 5381, 5531, 5591, 5641, 5801, 5881, 6011, 6101, 6211, 6271, 6491, 6841
Offset: 1

Views

Author

Keywords

Comments

From A.H.M. Smeets, Nov 15 2023: (Start)
Mean gap size between two consecutive terms at p: ~ 20*log(p) (see E. Lehmer).
In E. Lehmer, Artiads characterized, she counted in the table on p. 122 the primes p for which p == 1 (mod 5) instead of all primes. As a result, in the corollary on p. 121, the 20% becomes 5% (or 1/20 instead of 1/5). (End)

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A047650, A000045, A024894, subsequence of A030430.
See also A270798 (a subsequence), A270800.

Programs

  • Haskell
    a001583 n = a001583_list !! (n-1)
    a001583_list = filter
       (\p -> mod (a000045 $ div (p - 1) 5) p == 0) a030430_list
    -- Reinhard Zumkeller, Aug 15 2013
    
  • Mathematica
    Select[ Prime[ Range[1000]], Mod[#, 5] == 1 && Divisible[ Fibonacci[(# - 1)/5], #] &] (* Jean-François Alcover, Jun 22 2012 *)
  • PARI
    fibmod(n, m)=((Mod([1, 1; 1, 0], m))^n)[1, 2]
    list(lim)=my(v=List()); forprime(p=11,lim, if(p%5==1 && fibmod(p\5,p)==0, listput(v,p))); Vec(v) \\ Charles R Greathouse IV, Feb 06 2017

Formula

From A.H.M. Smeets, Nov 15 2023: (Start)
Equals {prime(m): A296240(m) == 0 (mod 5)}.
a(n) ~ prime(20*n). (End)

Extensions

More terms from James Sellers, Jan 25 2000
Edited by N. J. A. Sloane, Apr 01 2016

A060305 Pisano periods for primes: period of Fibonacci numbers mod prime(n).

Original entry on oeis.org

3, 8, 20, 16, 10, 28, 36, 18, 48, 14, 30, 76, 40, 88, 32, 108, 58, 60, 136, 70, 148, 78, 168, 44, 196, 50, 208, 72, 108, 76, 256, 130, 276, 46, 148, 50, 316, 328, 336, 348, 178, 90, 190, 388, 396, 22, 42, 448, 456, 114, 52, 238, 240, 250, 516, 176, 268, 270, 556
Offset: 1

Views

Author

Louis Mello (mellols(AT)aol.com), Mar 26 2001

Keywords

Comments

Assuming Wall's conjecture (which is still open) allows one to calculate A001175(m) when m is a prime power since for any k >= 1: A001175(prime(n)^k) = a(n)*prime(n)^(k-1). For example: A001175(2^k) = 3*2^(k-1) = A007283(k-1).

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local F, k, p;
          F:=[1,1]; p:=ithprime(n);
          for k while F<>[0,1] do
            F:=[F[2], irem(F[1]+F[2],p)]
          od: k
        end:
    seq(a(n), n=1..70);  # Alois P. Heinz, Oct 16 2015
  • Mathematica
    Table[p=Prime[n]; a={1,0}; a0=a; k=0; While[k++; s=Mod[Plus@@a,p];a=RotateLeft[a]; a[[2]]=s; a!=a0]; k, {n,100}] (* T. D. Noe, Jun 12 2006 *)
  • PARI
    for(n=1,100,s=1; while(sum(i=n,n+s,abs(fibonacci(i)%prime(n)-fibonacci(i+s)%prime(n)))+sum(i=n+1,n+1+s,abs(fibonacci(i)%prime(n)-fibonacci(i+s)%prime(n)))>0,s++); print1(s,","))
    
  • Python
    from itertools import count
    from sympy import prime
    def A060305(n):
        x, p = (1,1), prime(n)
        for k in count(1):
            if x == (0,1):
                return k
            x = (x[1], (x[0]+x[1]) % p) # Chai Wah Wu, May 31 2022

Formula

a(n) = A001175(prime(n)). - Jonathan Sondow, Dec 09 2017
a(n) = (3 - L(p))/2 * (p - L(p)) / A296240(n) for n >= 4, where p = prime(n) and L(p) = Legendre(p|5); so a(n) <= p-1 if p == +- 1 mod 5, and a(n) <= 2*p+2 if p == +- 2 mod 5. See Wall's Theorems 6 and 7. - Jonathan Sondow, Dec 10 2017

Extensions

Corrected by Benoit Cloitre, Jun 04 2002
Name clarified by Jonathan Sondow, Dec 09 2017

A047650 Primes for which golden mean tau is a quadratic residue.

Original entry on oeis.org

29, 89, 101, 181, 229, 349, 401, 461, 509, 521, 541, 709, 761, 769, 809, 941, 1009, 1021, 1049, 1061, 1109, 1229, 1249, 1289, 1361, 1409, 1549, 1601, 1621, 1669, 1709, 1721, 1741, 1789, 1861, 2029, 2069, 2081, 2089, 2389, 2441, 2621, 2729, 2801, 2861
Offset: 0

Views

Author

Keywords

Comments

Primes of the form x^2 + 20*y^2. - T. D. Noe, May 08 2005
Also primes p that divide the sum of cubes of the first (p-1)/2 Fibonacci numbers A005968((p-1)/2). - Alexander Adamchuk, Aug 07 2006
From A.H.M. Smeets, Nov 16 2023: (Start)
Mean gap size between two consecutive terms at p: ~ 8*log(p).
In x^2 + 20y^2: x == 1 (mod 2) and x !== 5 (mod 10). Otherwise not prime. (End)

Crossrefs

Programs

  • Magma
    k:=20; [p: p in PrimesUpTo(3000) | NormEquation(k, p) eq true]; // Vincenzo Librandi, Sep 05 2016
  • Mathematica
    nn=20; pMax=3000; Union[Reap[Do[p=x^2 + nn*y^2; If[p<=pMax&&PrimeQ[p], Sow[p]], {x, Sqrt[pMax]}, {y, Sqrt[pMax/nn]}]][[2, 1]]] (* Vincenzo Librandi, Sep 05 2016 *)

Formula

From A.H.M. Smeets, Nov 16 2023: (Start)
Equals {prime(n): A296240(n) in {2^k: k > 0}} = {A308787} union {A308789} union {A308793} union ... .
a(n) ~ A000040(8*n). (End)

Extensions

More terms from James Sellers, Jan 25 2000

A222413 All primes p > 5 such that A001175(p) is smaller than the maximal value permitted by Wall's Theorems 6 and 7.

Original entry on oeis.org

29, 47, 89, 101, 107, 113, 139, 151, 181, 199, 211, 229, 233, 263, 281, 307, 331, 347, 349, 353, 401, 421, 461, 509, 521, 541, 557, 563, 619, 661, 677, 691, 709, 743, 761, 769, 797, 809, 811, 829, 859, 881, 911, 919, 941, 953, 967, 977, 991, 1009, 1021, 1031, 1049, 1061, 1069, 1087, 1097, 1103, 1109, 1151, 1217, 1223, 1229, 1231, 1249, 1277
Offset: 1

Views

Author

N. J. A. Sloane, Feb 28 2013

Keywords

Comments

Included because A001175 is still a mystery (as are many sequences of the same type).
A222414 gives the corresponding values of A001175(a(n)).
The maximal value for a prime p > 5 is p-1 if p == 1 or 9 (mod 10) and 2*(p+1) if p == 3 or 7 (mod 10). See Wall's Theorems 6 and 7. These values are given in A253806. - Wolfdieter Lang, Jan 16 2015
Prime(n) is a member if and only if A296240(n) > 1. - Jonathan Sondow, Dec 10 2017

Examples

			From _Wolfdieter Lang_, Jan 16 2015: (Start)
a(1) = 29 because A001175(29) = 14 but the maximal value is 29 - 1 = 28.
a(2) = 47 because A001175(47) = 32 but the maximal value is 2*(47 + 1) = 96.
All other primes p > 5 have A001175(p) = maximal value for p.
E.g., p = 11 has  A001175(11) = 11-1 = 10 and  p = 7 has A001175(7) = 2*(7 + 1) = 16. (End)
		

Crossrefs

Extensions

Name corrected by Wolfdieter Lang, Jan 16 2015

A339855 Primes p such that the absolute value of the fraction A241014(A000720(p)) / p is a record low.

Original entry on oeis.org

2, 3, 5, 17, 41, 101, 163, 223, 251, 733, 1063, 27191, 77969, 84299, 86813, 123863, 508771, 1677209, 11634179, 91978037, 443127523, 467335159, 1041968177, 2025051311, 13941800291, 24178397183, 762383958397, 766193665711, 1551559563569, 8030311150847
Offset: 1

Views

Author

Jeppe Stig Nielsen, Dec 19 2020

Keywords

Comments

So-called near-Wall-Sun-Sun primes. Each term is "nearer" to being Wall-Sun-Sun than all smaller primes.
If any Wall-Sun-Sun primes exist, this sequence terminates at the smallest Wall-Sun-Sun prime.
If you start from p=7 (not p=2), then the sequence will start 7, 13, 17, 41, ... instead.

Crossrefs

Programs

  • PARI
    rec=+oo;forprime(p=2,,r=abs(centerlift(((Mod([1, 1; 1, 0], p^2))^(p-kronecker(p, 5)-1))[1, 1]))/p^2;if(r
    				

A347565 Primes p such that A241014(A000720(p)) is +1 or -1.

Original entry on oeis.org

2, 3, 5, 17, 251, 733, 1063, 123863, 1677209, 6336823451747417, 104868559750360787, 7665762181374748069
Offset: 1

Views

Author

Jeppe Stig Nielsen, Sep 06 2021

Keywords

Comments

Very near misses for Wall-Sun-Sun primes.

Crossrefs

A366951 a(n) = 2*(p_n - 1)/A060305(n) iff p_n == +/- 1 (mod 5), 2*(p_n + 1)/A060305(n) iff p_n == +/- 2 (mod 5), 0 iff p_n = 5.

Original entry on oeis.org

2, 1, 0, 1, 2, 1, 1, 2, 1, 4, 2, 1, 2, 1, 3, 1, 2, 2, 1, 2, 1, 2, 1, 4, 1, 4, 1, 3, 2, 3, 1, 2, 1, 6, 2, 6, 1, 1, 1, 1, 2, 4, 2, 1, 1, 18, 10, 1, 1, 4, 9, 2, 2, 2, 1, 3, 2, 2, 1, 10, 1, 1, 7, 2, 1, 1, 6, 1, 3, 4, 3, 2, 1, 1, 2, 1, 2, 1, 4, 2, 2, 10, 2, 1, 2, 1
Offset: 1

Views

Author

A.H.M. Smeets, Oct 29 2023

Keywords

Crossrefs

Formula

a(n) == 0 (mod 2) for prime(n) == +/- 1 (mod 5) and n > 2.
a(n) == 1 (mod 2) for Prime(n) == +/- 2 (mod 5) and n > 2.
a(n) = 1 iff prime(n) in A071774.
a(n) = 2 iff prime(n) in ({2} union A003147)/{5}.
a(n) = 3 iff prime(n) in A308784.
a(n) = 4 iff prime(n) in A308787.
a(n) = 6 iff prime(n) in A308788.
a(n) = 7 iff prime(n) in A308785.
a(n) = 8 iff prime(n) in A308789.
a(n) = 9 iff prime(n) in A308786.
a(n) = 10 iff prime(n) in A308790.
a(n) = 12 iff prime(n) in A308791.
a(n) = 14 iff prime(n) in A308792.
a(n) = 16 iff prime(n) in A308793.
a(n) = 18 iff prime(n) in A308794.
a(n) = A296240(n) iff prime(n) == +/- 2 (mod 5) and n > 3.
a(n) = 2*A296240(n) iff prime(n) == +/- 1 (mod 5) and n > 3.
a(n) in {2^k: k > 1} iff prime(n) in {A047650}.
a(n) == 3 (mod 6) iff prime(n) in {A124096}.
a(n) == 6 (mod 12) iff prime(n) in {A046652}.
a(n) == 0 (mod 14) iff prime(n) in {A125252}.
Showing 1-8 of 8 results.