OFFSET
2,1
COMMENTS
Sequence and first differences:
2 5 12 23 36 53 72 101 132 169 210 253 300 359 420...
.3.7.11.13.17.19.29...31..37..41..43..47..59..61...
EXAMPLE
All prime numbers appear once and only once, either in the sequence itself or in the first differences.
MAPLE
A109653diff :=proc(n)
option remember ;
if n = 2 then
3;
else
for pidx from 1 do
fnd := false;
p := ithprime(pidx) ;
for i from 2 to n-1 do
if procname(i) = p then
fnd := true;
end if;
end do:
for i from 2 to n do
if A109653(i) = p then
fnd := true;
end if;
end do:
if not fnd then
return p;
end if;
end do:
end if;
end proc:
A109653 :=proc(n)
if n = 2 then
2 ;
else
procname(n-1)+A109653diff(n-1) ;
end if;
end proc:
seq(A109653(n), n=2..80) ; # R. J. Mathar, Nov 05 2024
MATHEMATICA
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; a = {1}; d = 3; k = 2; Do[ While[ Position[a, d] != {}, d += 2 ]; k = k + d; d = NextPrim[d]; a = Append[a, k], {n, 47} ]; a (* Robert G. Wilson v *)
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Eric Angelini, Aug 30 2005
EXTENSIONS
More terms from Robert G. Wilson v, Sep 28 2005
STATUS
approved