login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A284412
a(1) = 1, a(2) = 2; a(n) is the largest prime <= (a(a(n-1)) + a(n-a(n-1))) for n > 2.
1
1, 2, 3, 3, 5, 5, 7, 7, 7, 7, 7, 11, 7, 13, 7, 13, 7, 13, 11, 13, 13, 13, 13, 13, 17, 13, 19, 17, 17, 13, 19, 17, 19, 17, 19, 17, 19, 19, 23, 19, 23, 23, 23, 23, 23, 23, 23, 29, 29, 29, 29, 29, 29, 31, 31, 31, 31, 37, 31, 31, 31, 37, 31, 37, 31, 37, 31, 37, 31, 41, 31, 41, 37, 37, 37, 41, 37, 41, 41, 43
OFFSET
1,2
LINKS
FORMULA
a(1) = 1, a(2) = 2; a(n) = A007917(a(a(n-1)) + a(n-a(n-1))) for n > 2.
EXAMPLE
a(6) = 5 because a(a(5)) + a(6 - a(5)) = a(5) + a(1) = 5 + 1 = 6 and A007917(6) = 5
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-1]])); a
CROSSREFS
KEYWORD
nonn
AUTHOR
Altug Alkan, Mar 26 2017
STATUS
approved