OFFSET
1,5
COMMENTS
a(n) = 0 iff the n-th composite number is a perfect power.
First occurrence of k or 0 if impossible: 2,8,5,12,7,38,0,21,13,26,16,61,0,35,22,40,25,84,0,49,31,156,0,111,0...,.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
FORMULA
MATHEMATICA
Composite[n_] := FixedPoint[n + 1 + PrimePi[ # ] &, n]; f[n_] := Block[{a = First@Transpose@FactorInteger@n}, a[[ -1]] - a[[1]]]; f[n_] := Block[{a = First@Transpose@FactorInteger@n}, a[[ -1]] - a[[1]]] (* Robert G. Wilson v *)
dif[n_]:=Module[{f=Transpose[FactorInteger[n]][[1]]}, If[PrimeQ[n], {}, Last[ f]- First[f]]]; Flatten[Table[dif[n], {n, 4, 200}]] (* Harvey P. Dale, May 12 2014 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Giovanni Teofilatto, Nov 13 2005
EXTENSIONS
More terms from Robert G. Wilson v, Nov 17 2005
Corrected a(19). - Juri-Stepan Gerasimov, Jun 16 2009
a(19)=3 inserted by Klaus Brockhaus, Jun 25 2009
STATUS
approved