OFFSET
1,10
COMMENTS
Even nonzero terms correspond to odd composite numbers that are not powers of primes. Terms of A030173 appear in this sequence infinitely often. - Alonso del Arte, Nov 27 2011
REFERENCES
Handbook of Number Theory, D. S. Mitrinovic et al., Kluwer, Section IV.1.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
MAPLE
a:= n-> `if`(n=1, 0, (s-> max(s)-min(s))(numtheory[factorset](n))):
seq(a(n), n=1..100); # Alois P. Heinz, Mar 07 2020
MATHEMATICA
f[n_]:=Transpose[FactorInteger[n]][[1]]; Table[Last[f[n]-First[f[n]]], {n, 200}] (* Vladimir Joseph Stephan Orlovsky, Apr 08 2011 *)
lpd[n_]:=Module[{fi=FactorInteger[n]}, fi[[-1, 1]]-fi[[1, 1]]]; Array[lpd, 90] (* Harvey P. Dale, Dec 31 2017 *)
PROG
(Haskell)
a046665 n = a006530 n - a020639 n -- Reinhard Zumkeller, Jul 03 2015
(PARI) a(n)={if(n==1, 0, my(f=factor(n)[, 1]); f[#f]-f[1])} \\ Andrew Howroyd, Mar 07 2020
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
EXTENSIONS
More terms from James A. Sellers
STATUS
approved