A001221 Number of distinct primes dividing n (also called omega(n)).
0, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 3, 1, 2, 2, 1, 2, 3, 1, 2, 2, 3, 1, 2, 1, 2, 2, 2, 2, 3, 1, 2, 1, 2, 1, 3, 2, 2, 2, 2, 1, 3, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 3, 1, 2, 3, 2, 1, 2, 1, 3, 2
Offset: 1
References
- M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 844.
- G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, pp. 48-57.
- J. Peters, A. Lodge and E. J. Ternouth, E. Gifford, Factor Table (n<100000) (British Association Mathematical Tables Vol.V), Burlington House/Cambridge University Press London 1935.
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- N. J. A. Sloane and Daniel Forgues, Table of n, a(n) for n = 1..100000 (first 10000 from NJAS)
- M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards, Applied Math. Series 55, Tenth Printing, 1972 [alternative scanned copy].
- Henry Bottomley, Prime factors calculator
- J. Brennen, Prime Factoring Applet
- J. Britton, Prime Factorization Machine
- A. Dendane, Prime Factors Calculator
- Robert E. Dressler and Jan van de Lune, Some remarks concerning the number theoretic functions omega and Omega, Proc. Amer. Math. Soc. 41 (1973), 403-406
- J. Flament, Decomposition d'un nombre en facteurs premiers
- G. H. Hardy and S. Ramanujan, The normal number of prime factors of a number, Quart. J. Math. 48 (1917), 76-92. Also Collected papers of Srinivasa Ramanujan, AMS Chelsea Publ., Providence, RI (2000): 262-275.
- A. Hodges, Java Applet for Factorisation
- M. Kac, Statistical Independence in Probability, Analysis and Number Theory, Carus Monograph 12, Math. Assoc. Amer., 1959, see p. 64.
- S. O. S. Math, Prime factorization of the first 1000 integers
- K. Matthews, Factorization and calculating phi(n),omega(n),d(n),sigma(n) and mu(n)
- J. Moyer, "Prime Factors of Integers" server for numbers up to 10^36
- Primefan, The First 2500 Integers,Factored
- Primefan, Factorer
- F. Richman, Factoring into Primes
- Eric Weisstein's World of Mathematics, Distinct Prime Factors
- Eric Weisstein's World of Mathematics, Moebius Transform
- Eric Weisstein's World of Mathematics, Prime Factor
- Eric Weisstein's World of Mathematics, Prime zeta function primezeta(s).
- Wikipedia, Prime factor
- Wikipedia, Table of prime factors
- G. Xiao, WIMS server, Factoris
- Index entries for "core" sequences
- Index entries for sequences computed from exponents in factorization of n
Crossrefs
Cf. A001222 (primes counted with multiplicity), A046660, A285577, A346617. Partial sums give A013939.
Cf. also A125666, A069010, A087624, A091202, A091221, A143519, A144494, A158210, A156542, A156552, A000010, A008683.
Programs
-
Haskell
import Math.NumberTheory.Primes.Factorisation (factorise) a001221 = length . snd . unzip . factorise -- Reinhard Zumkeller, Nov 28 2015
-
Julia
using Nemo function NumberOfPrimeFactors(n; distinct=true) distinct && return length(factor(ZZ(n))) sum(e for (p, e) in factor(ZZ(n)); init=0) end println([NumberOfPrimeFactors(n) for n in 1:60]) # Peter Luschny, Jan 02 2024
-
Magma
[#PrimeDivisors(n): n in [1..120]]; // Bruno Berselli, Oct 15 2021
-
Maple
A001221 := proc(n) local t1, i; if n = 1 then return 0 else t1 := 0; for i to n do if n mod ithprime(i) = 0 then t1 := t1 + 1 end if end do end if; t1 end proc; A001221 := proc(n) nops(numtheory[factorset](n)) end proc: # Emeric Deutsch omega := n -> NumberTheory:-NumberOfPrimeFactors(n, 'distinct'): # Peter Luschny, Jun 15 2025
-
Mathematica
Array[ Length[ FactorInteger[ # ] ]&, 100 ] PrimeNu[Range[120]] (* Harvey P. Dale, Apr 26 2011 *)
-
MuPAD
func(nops(numlib::primedivisors(n)), n):
-
MuPAD
numlib::omega(n)$ n=1..110 // Zerinvary Lajos, May 13 2008
-
PARI
a(n)=omega(n)
-
Python
from sympy.ntheory import primefactors print([len(primefactors(n)) for n in range(1, 1001)]) # Indranil Ghosh, Mar 19 2017
-
Sage
def A001221(n): return sum(1 for p in divisors(n) if is_prime(p)) [A001221(n) for n in (1..80)] # Peter Luschny, Feb 01 2012
-
SageMath
[sloane.A001221(n) for n in (1..111)] # Giuseppe Coppoletta, Jan 19 2015
-
SageMath
[gp.omega(n) for n in range(1,101)] # G. C. Greubel, Jul 13 2024
Formula
G.f.: Sum_{k>=1} x^prime(k)/(1-x^prime(k)). - Benoit Cloitre, Apr 21 2003; corrected by Franklin T. Adams-Watters, Sep 01 2009
Dirichlet generating function: zeta(s)*primezeta(s). - Franklin T. Adams-Watters, Sep 11 2005
Additive with a(p^e) = 1.
a(1) = 0, a(p) = 1, a(pq) = 2, a(pq...z) = k, a(p^k) = 1, where p, q, ..., z are k distinct primes and k natural numbers. - Jaroslav Krizek, May 04 2009
a(n) = log_2(Sum_{d|n} mu(d)^2). - Enrique Pérez Herrero, Jul 09 2012
a(A002110(n)) = n, i.e., a(prime(n)#) = n. - Jean-Marc Rebert, Jul 23 2015
L.g.f.: -log(Product_{k>=1} (1 - x^prime(k))^(1/prime(k))) = Sum_{n>=1} a(n)*x^n/n. - Ilya Gutkovskiy, Jul 30 2018
a(n) = log_2(Sum_{k=1..n} mu(gcd(n,k))^2/phi(n/gcd(n,k))) = log_2(Sum_{k=1..n} mu(n/gcd(n,k))^2/phi(n/gcd(n,k))), where phi = A000010 and mu = A008683. - Richard L. Ollerton, May 13 2021
Sum_{k=1..n} 2^(-a(gcd(n,k)) - A001222(n/gcd(n,k)))/phi(n/gcd(n,k)) = Sum_{k=1..n} 2^(-A001222(gcd(n,k)) - a(n/gcd(n,k)))/phi(n/gcd(n,k)) = 1, where phi = A000010. - Richard L. Ollerton, May 13 2021
a(n) = A005089(n) + A005091(n) + A059841(n) = A005088(n) +A005090(n) +A079978(n). - R. J. Mathar, Jul 22 2021
From Wesley Ivan Hurt, Jun 22 2024: (Start)
a(n) = Sum_{p|n, p prime} 1.
a(n) = Sum_{d|n} c(d), where c = A010051. (End)
Comments