A099812 Number of distinct primes dividing 2n (i.e., omega(2n)).
1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 1, 3, 2, 3, 2, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 3, 2, 2, 3, 2, 2, 3, 1, 3, 3, 2, 2, 3, 3, 2, 2, 2, 2, 3, 2, 3, 3, 2, 2, 2, 2, 2, 3, 3, 2, 3, 2, 2, 3, 3, 2, 3, 2, 3, 2, 2, 2, 3, 2, 2, 3, 2, 2, 4
Offset: 1
Examples
a(6) = 2 because 12 = 2*2*3 has 2 distinct prime divisors. a(15) = 3 because 30 = 2*3*5 has 3 distinct prime divisors.
Links
- G. C. Greubel, Table of n, a(n) for n = 1..1000
Programs
-
Magma
[#PrimeDivisors(2*n): n in [1..100]]; // Vincenzo Librandi, Jul 26 2017
-
Maple
with(numtheory): omega:=proc(n) local div,A,j: div:=divisors(n): A:={}: for j from 1 to tau(n) do if isprime(div[j])=true then A:=A union {div[j]} else A:=A fi od: nops(A) end: seq(omega(2*n),n=1..130); # Emeric Deutsch, Mar 10 2005
-
Mathematica
Table[PrimeNu[2*n], {n,1,50}] (* G. C. Greubel, May 21 2017 *)
-
PARI
for(n=1,50, print1(omega(2*n), ", ")) \\ G. C. Greubel, May 21 2017
Formula
From Amiram Eldar, Sep 21 2024: (Start)
a(n) = A001221(2*n).
a(n) = omega(n) + 1 if n is odd, and a(n) = omega(n) if n is even.
Sum_{k=1..n} a(k) = n * (log(log(n)) + B + 1/2) + O(n/log(n)), where B is Mertens's constant (A077761). (End)
Extensions
More terms from Emeric Deutsch, Mar 10 2005
Comments