OFFSET
1,1
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..1000
FORMULA
a(1) = 2, a(n+1) = MIN {prime p | p >= a(n) + prime(n)} (where prime(n) is the n-th prime number).
Conjecture: a(n) ~ K*n^2*log(n). - Bill McEachen, Apr 04 2024
a(n) >= A007504(n) >> n^2 log n. On Cramér's conjecture, a(n) << n^2 log^2 n. - Charles R Greathouse IV, Apr 10 2024
EXAMPLE
a(5) = 29, since a(4) = 17, p(4) = 7 and 29 is the smallest prime which is not smaller than 17 + 7.
MATHEMATICA
NextPrime[n_] := (k = n; While[ ! PrimeQ[k], k++ ]; k); f[1] = 2; f[n_] := NextPrime[ f[n - 1] + Prime[n-1] ]; Table[ f[n], {n, 1, 50} ]
Transpose[NestList[{First[#]+1, NextPrime[Last[#]+Prime[First[#]]]}&, {1, 2}, 50]][[2]] (* Harvey P. Dale, Oct 23 2011 *)
PROG
(PARI) for (n=1, 1000, if (n>1, a=nextprime(a + prime(n - 1)), a=2); write("b064337.txt", n, " ", a) ) \\ Harry J. Smith, Sep 12 2009
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Lior Manor, Sep 13 2001
STATUS
approved