OFFSET
1,2
COMMENTS
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..5000
MAPLE
MATHEMATICA
Differences@ NestList[If[PrimeQ@ #, 2 #, # + 1] &, 1, 87] (* Michael De Vlieger, Dec 06 2018, after Harvey P. Dale at A080735 *)
PROG
(PARI) lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, va[n] = if (isprime(va[n-1]), 2*va[n-1], va[n-1]+1); ); vector(nn-1, n, va[n+1] - va[n]); } \\ Michel Marcus, Dec 06 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Aug 07 2009
EXTENSIONS
More terms from R. J. Mathar, Nov 05 2009
STATUS
approved