login
A109653
Sequence and first differences include all prime numbers exactly once.
2
2, 5, 12, 23, 36, 53, 72, 101, 132, 169, 210, 253, 300, 359, 420, 487, 558, 631, 710, 793, 882, 979, 1082, 1189, 1298, 1411, 1538, 1669, 1806, 1945, 2094, 2245, 2402, 2565, 2732, 2905, 3084, 3265, 3456, 3649, 3846, 4045, 4256, 4479, 4706, 4935, 5168, 5407
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
Sequence in context: A326762 A116711 A247658 * A115520 A116735 A096376
KEYWORD
base,easy,nonn
AUTHOR
Eric Angelini, Aug 30 2005
EXTENSIONS
More terms from Robert G. Wilson v, Sep 28 2005
STATUS
approved