login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A178921 Product of distances between successive distinct prime divisors of n; zero if n has only 1 distinct prime factor. 2

%I #27 May 20 2021 08:19:55

%S 0,0,0,0,0,1,0,0,0,3,0,1,0,5,2,0,0,1,0,3,4,9,0,1,0,11,0,5,0,2,0,0,8,

%T 15,2,1,0,17,10,3,0,4,0,9,2,21,0,1,0,3,14,11,0,1,6,5,16,27,0,2,0,29,4,

%U 0,8,8,0,15,20,6,0,1,0,35,2,17,4,10,0,3,0,39,0,4,12,41,26,9,0,2,6,21,28,45,14,1,0,5,8,3,0,14,0,11

%N Product of distances between successive distinct prime divisors of n; zero if n has only 1 distinct prime factor.

%C For n <= 41, a(n) = A049087(n).

%H Antti Karttunen, <a href="/A178921/b178921.txt">Table of n, a(n) for n = 1..65537</a>

%t 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 *)

%t Array[Apply[Times, Differences@ FactorInteger[#][[All, 1]] /. {} -> 0] &, 105] (* _Michael De Vlieger_, Sep 10 2018 *)

%o (Python)

%o from sympy import primerange

%o primes = list(primerange(2,500))

%o for n in range(1,100):

%o d = n

%o prev = 0

%o product = 1

%o for p in primes:

%o if d%p==0:

%o if prev:

%o product *= p-prev

%o while d%p==0:

%o d//=p

%o if d==1:

%o break

%o prev = p

%o if prev==0:

%o product = 0

%o print(product, end=',')

%o (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

%Y Cf. A081060, A049087.

%Y Cf. also A137795.

%K nonn,easy

%O 1,10

%A _Alex Ratushnyak_, Aug 18 2012

%E More terms from _Antti Karttunen_, Sep 07 2018

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 20 00:03 EDT 2024. Contains 371798 sequences. (Running on oeis4.)