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

A005478 Prime Fibonacci numbers.

Original entry on oeis.org

2, 3, 5, 13, 89, 233, 1597, 28657, 514229, 433494437, 2971215073, 99194853094755497, 1066340417491710595814572169, 19134702400093278081449423917, 475420437734698220747368027166749382927701417016557193662268716376935476241
Offset: 1

Views

Author

Keywords

Comments

a(n) == 1 (mod 4) for n > 2. (Proof. Otherwise 3 < a(n) = F_k == 3 (mod 4). Then k == 4 (mod 6) (see A079343 and A161553) and so k is not prime. But k is prime since F_k is prime and k != 4 - see Caldwell.)
More generally, A190949(n) == 1 (mod 4). - N. J. A. Sloane
With the exception of 3, every term of this sequence has a prime index in the sequence of Fibonacci numbers (A000045); e.g., 5 is the fifth Fibonacci number, 13 is the seventh Fibonacci number, 89 the eleventh, etc. - Alonso del Arte, Aug 16 2013
Note: A001605 gives those indices. - Antti Karttunen, Aug 16 2013
The six known safe primes 2p + 1 such that p is a Fibonacci prime are in A263880; the values of p are in A155011. There are only two known Fibonacci primes p for which 2p - 1 is also prime, namely, p = 2 and 3. Is there a reason for this bias toward prime 2p + 1 over 2p - 1 among Fibonacci primes p? - Jonathan Sondow, Nov 04 2015

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 89, p. 32, Ellipses, Paris 2008.
  • R. K. Guy, Unsolved Problems in Number Theory, Section A3.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Subsequence of A178762.
Column k=1 of A303216.

Programs

  • Mathematica
    Select[Fibonacci[Range[400]], PrimeQ] (* Alonso del Arte, Oct 13 2011 *)
  • PARI
    je=[]; for(n=0,400, if(isprime(fibonacci(n)),je=concat(je,fibonacci(n)))); je
    
  • Python
    from itertools import islice
    from sympy import isprime
    def A005478_gen(): # generator of terms
        a, b = 1, 1
        while True:
            if isprime(b):
                yield b
            a, b = b, a+b
    A005478_list = list(islice(A005478_gen(),10)) # Chai Wah Wu, Jun 25 2024
  • Sage
    [i for i in fibonacci_xrange(0,10^80) if is_prime(i)] # Bruno Berselli, Jun 26 2014
    

Formula

a(n) = A000045(A001605(n)). A000040 INTERSECT A000045. - R. J. Mathar, Nov 01 2007

Extensions

Sequence corrected by Enoch Haga, Feb 11 2000
One more term from Jason Earls, Jul 12 2001
Comment and proof added by Jonathan Sondow, May 24 2011

A002708 a(n) = Fibonacci(n) mod n.

Original entry on oeis.org

0, 1, 2, 3, 0, 2, 6, 5, 7, 5, 1, 0, 12, 13, 10, 11, 16, 10, 1, 5, 5, 1, 22, 0, 0, 25, 20, 11, 1, 20, 1, 5, 13, 33, 30, 0, 36, 1, 37, 35, 1, 34, 42, 25, 20, 45, 46, 0, 36, 25, 32, 23, 52, 8, 5, 21, 40, 1, 1, 0, 1, 1, 43, 59, 60, 52, 66, 65, 44, 15, 1, 0, 72, 73, 50, 3, 2, 44, 1, 5, 7, 1, 82, 24
Offset: 1

Views

Author

John C. Hallyburton, Jr. (hallyb(AT)evms.ENET.dec.com)

Keywords

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002, p. 891.

Crossrefs

Cf. A002726, A002752, A023172 (indices of 0's), A023173 (indices of 1's), A023174-A023182.
Cf. A263101.
Main diagonal of A161553.

Programs

  • Magma
    [Fibonacci(n) mod n : n in [1..120]]; // Vincenzo Librandi, Nov 19 2015
    
  • Maple
    with(combinat): [ seq( fibonacci(n) mod n, n=1..80) ];
    # second Maple program:
    a:= proc(n) local r, M, p; r, M, p:=
          <<1|0>, <0|1>>, <<0|1>, <1|1>>, n;
          do if irem(p, 2, 'p')=1 then r:= r.M mod n fi;
             if p=0 then break fi; M:= M.M mod n
          od; r[1, 2]
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Nov 26 2016
  • Mathematica
    Table[Mod[Fibonacci[n], n], {n, 1, 100}] (* Stefan Steinerberger, Apr 18 2006 *)
  • PARI
    a(n) = fibonacci(n) % n; \\ Michel Marcus, May 11 2016
  • Python
    A002708_list, a, b, = [], 1, 1
    for n in range(1,10**4+1):
        A002708_list.append(a%n)
        a, b = b, a+b # Chai Wah Wu, Nov 26 2015
    

Extensions

More terms from Stefan Steinerberger, Apr 18 2006

A214300 Sum of the terms of the Pisano period mod n.

Original entry on oeis.org

0, 2, 9, 8, 40, 66, 49, 32, 99, 280, 33, 108, 156, 322, 285, 144, 272, 198, 133, 560, 105, 264, 529, 216, 1200, 1040, 945, 532, 116, 1770, 372, 608, 495, 544, 1365, 324, 1332, 228, 1053, 1120, 779, 798, 1849, 484, 2655, 1058, 705, 432, 2695, 7400, 1785, 1976, 2756
Offset: 1

Views

Author

Keywords

Comments

Row sums of A161553.

Crossrefs

Programs

  • PARI
    a(n)=if(n==1,return(0));my(a=0,b=1,s=1,t);while(b||a!=1,s+=a;t=a;a=b;b+=t;if(b>=n,b-=n));s

Formula

a(n) = n * A088551(n).

A376081 Irregular triangle read by rows: row n is the periodic part of the Leonardo numbers (A001595) modulo n.

Original entry on oeis.org

0, 1, 1, 1, 0, 2, 0, 0, 1, 2, 1, 1, 3, 1, 1, 3, 0, 4, 0, 0, 1, 2, 4, 2, 2, 0, 3, 4, 3, 3, 2, 1, 4, 1, 1, 3, 5, 3, 3, 1, 5, 1, 1, 3, 5, 2, 1, 4, 6, 4, 4, 2, 0, 3, 4, 1, 6, 1, 1, 3, 5, 1, 7, 1, 1, 3, 5, 0, 6, 7, 5, 4, 1, 6, 8, 6, 6, 4, 2, 7, 1, 0, 2, 3, 6, 1, 8
Offset: 1

Views

Author

Paolo Xausa, Sep 09 2024

Keywords

Comments

Each row n >= 3 ends in (1, n-1) (see Wikipedia article).

Examples

			Triangle begins:
  [1]  0;
  [2]  1;
  [3]  1, 1, 0, 2, 0, 0, 1, 2;
  [4]  1, 1, 3;
  [5]  1, 1, 3, 0, 4, 0, 0, 1, 2, 4, 2, 2, 0, 3, 4, 3, 3, 2, 1, 4;
  [6]  1, 1, 3, 5, 3, 3, 1, 5;
  [7]  1, 1, 3, 5, 2, 1, 4, 6, 4, 4, 2, 0, 3, 4, 1, 6;
  [8]  1, 1, 3, 5, 1, 7;
  [9]  1, 1, 3, 5, 0, 6, 7, 5, 4, 1, 6, 8, 6, 6, 4, 2, 7, 1, 0, 2, 3, 6, 1, 8;
  ...
For n = 8:
A001595       = 1, 1, 3, 5, 9, 15, 25, 41, 67, 109, 177, 287, 465, ...
A001595 mod 8 = 1, 1, 3, 5, 1,  7,  1,  1,  3,   5,   1,   7,   1, ...
                \_______________/
                  periodic part
		

Crossrefs

Cf. A001595, A161553, A376082 (row lengths), A376083 (row sums).

Programs

  • Mathematica
    A376081row[n_] := If[n < 3, {n - 1}, Module[{k = 1}, NestWhileList[Mod[2 * Fibonacci[++k] - 1, n] &, 1, {#, #2} != {1, n-1} &, {3, 2}]]];
    Array[A376081row, 10]

Formula

T(n,k) = A001595(k) mod n, with 0 <= k < A376082(n).

A361233 Numbers k such that the "Pisano cycle modulo k shape" is bounded.

Original entry on oeis.org

1, 2, 4, 5, 6, 8, 10, 11, 12, 14, 16, 18, 19, 20, 22, 24, 28, 29, 30, 31, 32, 36, 37, 38, 40, 42, 44, 46, 48, 50, 52, 53, 54, 55, 56, 58, 59, 60, 62, 64, 66, 68, 70, 71, 72, 76, 78, 79, 80, 82, 84, 86, 88, 89, 90, 92, 94, 95, 96, 98, 100, 101, 102, 104, 106, 108, 109, 110, 112
Offset: 1

Views

Author

Luca Onnis, Mar 05 2023

Keywords

Comments

Let k be a positive integer and consider the Pisano cycle of Fibonacci numbers modulo k. We define the "Pisano cycle modulo k shape" to be the 2-dimensional shape obtained by applying the following process:
Step 1: Start from the origin of a 2-dimensional grid.
Step 2: Consider the first number of the Pisano cycle: if it's 0, then stay still in the position you were before; otherwise, if it's even, then turn 90 degrees counterclockwise and take a 1-unit step; if it's odd, then turn 90 degrees clockwise and take a 1-unit step.
Step 3: Continue this process for all the numbers in the Pisano cycle modulo n.
Step 4: When you have applied the above rules to all the numbers, repeat the entire process again and again, each time starting from the position where the previous iteration ended.
Some shapes seem to repeat; for example, the shapes associated with k = 6, 12, 14 are the same.
The condition for being bounded is that after processing one iteration of the Pisano cycle then either current direction must be different from the initial direction or the current position must be the origin.

Examples

			For k = 2 the Pisano Cycle modulo 2 of the Fibonacci numbers is (1,1,0) and the shape obtained by iterating the process described above is a 1-unit square, which is bounded, so a(2) = 2.
		

Crossrefs

Programs

  • PARI
    \\ P(n) gives n-th row of A161553.
    P(n)={my(L=List([0]), X=Mod([1,1;1,0],n), I=Mod([1,0;0,1],n), M=X, k=1); while(M<>I, k++; M*=X; listput(L, lift(M[2,2]))); Vec(L)}
    isok(n)={my(s=P(n), x=0, y=0, dx=1, dy=0, t); for(i=1, #s, if(s[i], [dx,dy]=if(s[i]%2, [dy, -dx], [-dy, dx]); x+=dx; y+=dy)); (x==0&&y==0) || dx!=1}
    select(isok, [1..100]) \\ Andrew Howroyd, Mar 05 2023

A386277 For n >= 0, a(n) is the least Fibonacci number F_i (A000045) such that for some k >= 0, F_i = (n + 1)*(n + 2*k)/2, or a(n) = -1 if no such k exists.

Original entry on oeis.org

0, 1, 3, 34, 55, 21, 21, -1, 144, 55, 55, -1, 377, 987, 6765, 2584, 2584, -1, 2584, 610, 987, 6765, 46368, -1, 75025, 377, 14930352, -1, 317811, 6765, 832040, 14930352, 6765, -1, 102334155, -1, 4181, -1, 317811, -1, 6765, 987, 701408733, -1, 1548008755920, -1, 2178309, -1, 225851433717
Offset: 0

Views

Author

Ctibor O. Zizka, Jul 17 2025

Keywords

Comments

n even: F_i exists for all even n. Proof: For n even we have (n*(n + 1)/2) mod (n + 1) = 0. The residue 0 is among the residues of the Pisano period of (Fibonacci sequence mod (n + 1)) for all n.
n odd: F_i exists only if the residue (n*(n + 1)/2) mod (n + 1) = (n + 1)/2 is among the residues of the Pisano period of (Fibonacci sequence mod (n + 1)).
Computational result: it looks like a(2*A367420(n) - 1) = -1, checked for n from [1, 2000].
The lower bound for nonnegative a(n) is n*(n + 1)/2.
Empirical observation: for a(n) = F_i, i = t*A001177(n + 1), t is from {1/3, 1/2, 2/3, 1, 3/2, 2}.

Examples

			For n = 3: (3 + 1)*(3 + 2*k)/2 = 6 + 4*k is a Fibonacci number at first for k = 7. Thus a(3) = 34.
For n = 7: (7 + 1)*(7 + 2*k)/2 = 28 + 8*k. (Fib_i congruent to 4 mod 8) has no solution because the Fibonacci sequence modulo 8 has a period of 12: (1, 1, 2, 3, 5, 0, 5, 5, 2, 7, 1, 0), the residues are {0, 1, 2, 3, 5, 7} and 4 is not among them. Thus a(7) = -1.
For n = 11: (11 + 1)*(11 + 2*k)/2 = 66 + 12*k . (Fib_i congruent to 6 mod 12) has no solution because the Fibonacci sequence modulo 12 has a period of 24: (1, 1, 2, 3, 5, 8, 1, 9, 10, 7, 5, 0, 5, 5, 10, 3, 1, 4, 5, 9, 2, 11, 1, 0), the residues are {0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11} and 6 is not among them. Thus a(11) = -1.
		

Crossrefs

Programs

  • PARI
    isfib(n) = my(k=n^2); k+=(k+1)<<2; issquare(k) || (n>0 && issquare(k-8));
    row(n) = {my(L=List([0]), X=Mod([1, 1; 1, 0], n), I=Mod([1, 0; 0, 1], n), M=X); while(M<>I, M*=X; listput(L, lift(M[2, 2]))); Vec(L);} \\ A161553
    a(n) = my(p=(n + 1)*(n + 2*k)/2, x=polcoef(p, 1, 'k), y = polcoef(p, 0, 'k), v=row(x)); if (!vecsearch(Set(v),y % x), return(-1)); my(j=0); while ((denominator(jj=((2*fibonacci(j) - n*(n+1))/(2*(n+1)))) != 1) || (numerator(jj)<0), j++); fibonacci(j); \\ Michel Marcus, Jul 19 2025

Extensions

Corrected and extended by Michel Marcus, Jul 19 2025
Showing 1-6 of 6 results.