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!)
A284397 a(1) = 1, a(2) = 2; a(n) is the largest prime <= (a(a(n-1)) + a(n-a(n-2)-1)) for n > 2. 3
1, 2, 3, 3, 3, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 11, 11, 7, 7, 11, 11, 11, 11, 11, 11, 11, 11, 13, 17, 17, 13, 13, 13, 17, 17, 13, 13, 17, 17, 17, 17, 17, 17, 17, 17, 19, 23, 19, 17, 23, 19, 19, 19, 23, 23, 19, 19, 23, 23, 19, 19, 23, 23, 23, 23, 23, 23, 23, 23, 23 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(1) = 1, a(2) = 2; a(n) = A007917(a(a(n-1)) + a(n-a(n-2)-1)) for n > 2.
EXAMPLE
a(6) = 5 because a(a(5)) + a(6 - a(4) - 1) = a(3) + a(2) = 3 + 2 = 5 and A007917(5) = 5.
MATHEMATICA
a[n_]:= If[n<3, n, Prime@ PrimePi[a[a[n - 1]] + a[n - a[n - 2] - 1]]]; Table[a[n], {n, 1, 50}] (* Indranil Ghosh, Mar 26 2017 *)
PROG
(PARI) a=vector(1000); a[1]=1; a[2]=2; for(n=3, #a, a[n] = precprime(a[a[n-1]]+a[n-a[n-2]-1])); a
CROSSREFS
Sequence in context: A372546 A136348 A353710 * A284374 A137847 A295820
KEYWORD
nonn
AUTHOR
Altug Alkan, Mar 26 2017
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 August 29 16:41 EDT 2024. Contains 375517 sequences. (Running on oeis4.)