OFFSET
1,10
COMMENTS
a(n)=0 iff n a prime or a power of a prime. - Robert G. Wilson v, Jan 10 2005
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
EXAMPLE
For 24 = 2^3 *3, 2^3 and 3 are separated by 5, so a(30) = 5.
MATHEMATICA
pf[n_] := Block[{pb = Flatten[ Table[ #[[1]]^#[[2]], {1}] & /@ FactorInteger[n]]}, Max[pb] - Min[pb]]; Table[ pf[n], {n, 2, 100}] (* Robert G. Wilson v, Jan 10 2005 *)
PROG
(PARI) A100574(n) = if(1==n, 0, my(f=factor(n), v = vector(#f[, 1], i, f[i, 1]^f[i, 2])); vecmax(v)-vecmin(v)); \\ Antti Karttunen, Aug 06 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jan 02 2005
EXTENSIONS
More terms from Robert G. Wilson v, Jan 10 2005
STATUS
approved