OFFSET
1,10
COMMENTS
For n <= 41, a(n) = A049087(n).
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
MATHEMATICA
f[n_] := Module[{ps}, If[n <= 1, 0, ps = Transpose[FactorInteger[n]][[1]]; Times @@ Differences[ps]]]; Table[f[n], {n, 100}] (* T. D. Noe, Aug 20 2012 *)
Array[Apply[Times, Differences@ FactorInteger[#][[All, 1]] /. {} -> 0] &, 105] (* Michael De Vlieger, Sep 10 2018 *)
PROG
(Python)
from sympy import primerange
primes = list(primerange(2, 500))
for n in range(1, 100):
d = n
prev = 0
product = 1
for p in primes:
if d%p==0:
if prev:
product *= p-prev
while d%p==0:
d//=p
if d==1:
break
prev = p
if prev==0:
product = 0
print(product, end=', ')
(PARI) A178921(n) = if(1>=omega(n), 0, my(ps = factor(n)[, 1], m = 1); for(i=2, #ps, m *= (ps[i]-ps[i-1])); (m)); \\ Antti Karttunen, Sep 07 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Alex Ratushnyak, Aug 18 2012
EXTENSIONS
More terms from Antti Karttunen, Sep 07 2018
STATUS
approved