OFFSET
0,3
MATHEMATICA
fQ[n_] := GCD @@ Last /@ FactorInteger@n > 1; f[n_] := f[n] = Block[{k = f[n - 1] + n}, While[ !fQ@k, k++ ]; k]; f[0] = 0; f[1] = 1; Table[ f@n, {n, 0, 50}] (* Robert G. Wilson v, Jun 09 2009 *)
PROG
(Magma) P:=[1] cat [ n: n in [2..2500] | IsPower(n) ]; S:=[0]; p:=1; n:=1; while p le #P do if P[p] ge (S[ #S]+n) then Append(~S, P[p]); n+:=1; end if; p+:=1; end while; S; // Klaus Brockhaus, Jun 10 2009
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jun 06 2009
EXTENSIONS
STATUS
approved