OFFSET
0,1
LINKS
Ivan N. Ianakiev and Robert G. Wilson v, Table of n, a(n) for n = 0..100000
EXAMPLE
a(4) = 53 because prime(4) = 7, 53 == 4 (mod 7) and 53 is the smallest such prime greater than a(3) = 13.
MATHEMATICA
f[n_] := f[n] = Block[{k = Prime@ n, q = Prime@ n}, While[k + n <= f[n - 1] || ! PrimeQ[k + n], k += q]; k + n]; f[0] = 2; Array[f, 50, 0]
CROSSREFS
KEYWORD
nonn
AUTHOR
Ivan N. Ianakiev and Robert G. Wilson v, Aug 11 2015
STATUS
approved