OFFSET
1,1
EXAMPLE
For n = 4 we have a(n-1) = a(3) = 11, prime(n-1) = prime(3) = 5; a(3) + k*prime(3) = 11 + k*5 gives 16 for k = 1, 21 for k = 2, 26 for k = 3 and prime 31 for k = 4, hence a(4) = 31.
PROG
(PARI) {for(n=1, 42, if(n==1, a=3, p=prime(n-1); k=1; while(!isprime(r=a+k*p), k++); a=r); print1(a, ", "))}
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Amarnath Murthy, Jun 02 2004
EXTENSIONS
Edited and extended by Klaus Brockhaus, Jun 04 2004
STATUS
approved