login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A065435 a(3) = 2, a(4) = 3; for n > 4, a(n) = {a(n-2)}+{a(n-1)}, where {a} means largest prime <= a. 2
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
3,1
LINKS
FORMULA
a(n) = A007917(a(n-2)) + A007917(a(n-1)). - Jonathan Vos Post, Jul 10 2008
EXAMPLE
a(9) = 28 because 11+17 = 28 and 11 largest prime <= a(7) = 12 and 17 is largest prime <= a(8) = 18
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 *)
PROG
(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
(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
CROSSREFS
Sequence in context: A061419 A130732 A018135 * A301750 A086676 A055804
KEYWORD
nonn,easy,nice
AUTHOR
Bodo Zinser, Nov 17 2001
EXTENSIONS
More terms from Robert G. Wilson v, Nov 19 2001
Definition corrected by Harry J. Smith, Oct 18 2009
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 12:15 EDT 2024. Contains 371969 sequences. (Running on oeis4.)