OFFSET
1,1
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..1000
FORMULA
a(1) = 2, a(n+1) = MAX {prime p | p <= a(n) + p(n)} (where p(n) is the n-th prime number).
EXAMPLE
a(5) = 13, since a(4) = 7, p(4) = 7 and 13 is the largest prime which is not larger than 7 + 7.
MATHEMATICA
PrevPrime[n_] := (k = n; While[ ! PrimeQ[k], k-- ]; k); f[1] = 2; f[n_] := PrevPrime[ f[n - 1] + Prime[n] ]; Table[ f[n], {n, 1, 50} ]
PROG
(PARI) { for (n=1, 1000, if (n>1, a=precprime(a + prime(n - 1)), a=2); write("b064336.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 12 2009
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Lior Manor, Sep 13 2001
STATUS
approved