OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(5) = 10 and the least number more than 10 that gives a prime when increased by 10 is 13, 13 + 10 = 23.
MAPLE
A[1]:= 2;
for n from 2 to 100 do
A[n]:= nextprime(2*A[n-1])-A[n-1]
od:
seq(A[n], n=1..100); # Robert Israel, Aug 28 2018
MATHEMATICA
a=2; lst={a}; Do[b=a+1; While[ !PrimeQ[a+b], b++ ]; AppendTo[lst, b]; a=b, {n, 5!}]; lst (* Vladimir Joseph Stephan Orlovsky, Feb 07 2010 *)
NestList[NextPrime[2#]-#&, 2, 60] (* Harvey P. Dale, Jul 20 2011 *)
PROG
(PARI) FirstTerms(n)={my(x=2, y, a=vector(n), j=1); a[1]=2; while(j++<=n, y=x+1; while(!isprime(x+y), y++); x=y; a[j]=y); return(a)} \\ R. J. Cano, Jan 18 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Amarnath Murthy, Jun 05 2001
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), Jun 06 2001
STATUS
approved