OFFSET
1,2
COMMENTS
a(n) = 0 if n = m^p that is if n is a full power (square, cube etc.).
MATHEMATICA
powerQ[n_] := GCD @@ FactorInteger[n][[All, 2]] > 1; powerQ[1] = True; a[n_] := For[k = n, True, k++, If[powerQ[k], Return[k-n]]]; Table[a[n], {n, 1, 92}] (* Jean-François Alcover, Apr 19 2013 *)
PROG
(PARI) a(n) = { if (n==1, return (0)); my(nn = n); while(! ispower(nn), nn++); return (nn - n); } \\ Michel Marcus, Apr 19 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Oct 07 2002
STATUS
approved