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.

A055498 a(0)=0, a(1)=1, a(n) = smallest prime >= a(n-1) + a(n-2).

Original entry on oeis.org

0, 1, 2, 3, 5, 11, 17, 29, 47, 79, 127, 211, 347, 563, 911, 1481, 2393, 3877, 6271, 10151, 16427, 26591, 43019, 69623, 112643, 182279, 294923, 477209, 772139, 1249361, 2021501, 3270863, 5292367, 8563237, 13855607, 22418849, 36274471, 58693331, 94967809, 153661163
Offset: 0

Views

Author

N. J. A. Sloane, Jul 08 2000

Keywords

Examples

			After 3, 5, the next prime >=8 is 11.
		

Crossrefs

Programs

  • Haskell
    a055498 n = a055498_list !! n
    a055498_list = 0 : 1 : map a007918
        (zipWith (+) a055498_list $ tail a055498_list)
    -- Reinhard Zumkeller, Nov 13 2014
  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := a[n] = NextPrime[a[n - 1] + a[n - 2] -1]; Array[a, 37, 0] (* Robert G. Wilson v, Mar 13 2013 *)
    RecurrenceTable[{a[0]==0,a[1]==1,a[n]==NextPrime[a[n-1]+a[n-2]-1]},a,{n,50}] (* Harvey P. Dale, May 08 2013 *)
  • PARI
    a(n)=local(v);if(n<2,n>=0,n++;v=vector(n,i,1);for(i=3,n,v[i]=nextprime(v[i-1]+v[i-2]));v[n]) /* Michael Somos, Feb 01 2004 */
    

Formula

a(n+1) = nextprime(a(n) + a(n-1)) where nextprime(n) is smallest prime >= n.
a(n) is asymptotic to c*phi^n where phi = (1 + sqrt(5))/2 and c = 1.086541275044988562375... - Benoit Cloitre, May 02 2004
a(n) = A055499(n-1) for n>3. - Robert G. Wilson v, Mar 13 2013
a(n) = A007918(a(n-1) + a(n-2)) for n > 1. - Reinhard Zumkeller, Nov 13 2014