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.

A065435 a(3) = 2, a(4) = 3; for n > 4, a(n) = {a(n-2)}+{a(n-1)}, where {a} means largest prime <= a.

Original entry on oeis.org

2, 3, 5, 8, 12, 18, 28, 40, 60, 96, 148, 228, 366, 586, 936, 1506, 2428, 3922, 6342, 10256, 16590, 26826, 43394, 70212, 113598, 183798, 297388, 481174, 778548, 1259712, 2038242, 3297918, 5336130, 8634042, 13970112, 22604076, 36574162
Offset: 3

Views

Author

Bodo Zinser, Nov 17 2001

Keywords

Examples

			a(9) = 28 because 11+17 = 28 and 11 largest prime <= a(7) = 12 and 17 is largest prime <= a(8) = 18
		

Crossrefs

Programs

  • Haskell
    a065435 n = a065435_list !! (n-3)
    a065435_list = 2 : 3 : zipWith (+) xs (tail xs) where
                   xs = map (a007917 . fromInteger) a065435_list
    -- Reinhard Zumkeller, Aug 10 2012
  • Mathematica
    PrevPrim[n_] := Block[ {k = n}, While[ !PrimeQ[k], k-- ]; Return[k]]; a[3] = 2; a[4] = 3; a[n_] := a[n] = PrevPrim[ a[n - 1]] + PrevPrim[ a[n - 2]]; Table[ a[n], {n, 3, 45} ]
    np[n_]:=If[PrimeQ[n],n,NextPrime[n,-1]]; Transpose[NestList[{Last[#], np[Last[#]]+np[First[#]]}&,{2,3},40]][[1]] (* Harvey P. Dale, Oct 01 2011 *)
  • PARI
    for (n=3, 300, if (n>4, a=precprime(a2) + precprime(a1); a2=a1; a1=a, if (n==4, a=a1=3, a=a2=2)); write("b065435.txt", n, " ", a) ) \\ Harry J. Smith, Oct 18 2009
    

Formula

a(n) = A007917(a(n-2)) + A007917(a(n-1)). - Jonathan Vos Post, Jul 10 2008

Extensions

More terms from Robert G. Wilson v, Nov 19 2001
Definition corrected by Harry J. Smith, Oct 18 2009