|
|
A083743
|
|
a(1) = 1; if a(n-1) + n is prime then a(n) = a(n-1) + n, else a(n) = a(n-1).
|
|
3
|
|
|
1, 3, 3, 7, 7, 13, 13, 13, 13, 23, 23, 23, 23, 37, 37, 53, 53, 71, 71, 71, 71, 71, 71, 71, 71, 97, 97, 97, 97, 127, 127, 127, 127, 127, 127, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 211, 211, 211, 211, 263, 263, 317, 317, 373, 373, 431, 431, 491
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
MAPLE
|
a := proc(n) option remember: if n=1 then RETURN(1) fi: if isprime(a(n-1)+n) then RETURN(a(n-1)+n) else RETURN(a(n-1)) fi: end: for n from 1 to 100 do printf(`%d, `, a(n)) od: # James A. Sellers, May 19 2003
|
|
MATHEMATICA
|
a083743[n_] := Block[{i, t = Table[1, {n}]},
For[i = 1, i < n,
If[PrimeQ[t[[i - 1]] + i], t[[i]] = t[[i - 1]] + i,
nxt[{n_, a_}]:={n+1, If[PrimeQ[a+n+1], a+n+1, a]}; NestList[nxt, {1, 1}, 60][[All, 2]] (* Harvey P. Dale, Apr 28 2018 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|