PrimeOmega[n]
gives the number of prime factors counting multiplicities
in n.
PrimeOmega
PrimeOmega[n]
gives the number of prime factors counting multiplicities
in n.
Details and Options
- Integer mathematical function, suitable for both symbolic and numerical manipulation.
- PrimeOmega gives the number of prime factors of an integer with multiplicity.
- For a number
with
a unit and
primes, PrimeOmega[n] returns k1+⋯+km. - With the setting GaussianIntegers->True, PrimeOmega gives the number of Gaussian prime factors.
- PrimeOmega[m+In] automatically works over Gaussian integers.
Examples
open all close allBasic Examples (2)
Compute PrimeOmega at 30:
PrimeOmega[30]Plot the PrimeOmega sequence for the first 100 numbers:
DiscretePlot[PrimeOmega[n], {n, 100}]Scope (8)
Numerical Evaluation (4)
PrimeOmega works over integers:
PrimeOmega[12]PrimeOmega[5 + 9I]PrimeOmega[12, GaussianIntegers -> True]PrimeOmega[30!]PrimeOmega threads over lists:
PrimeOmega[{4, 12, 24}]Symbolic Manipulation (4)
TraditionalForm formatting:
PrimeOmega[n]//TraditionalFormReduce[PrimeOmega[n] ^ 2 + n == n + 1 && 0 < n < 10, n, Integers]Solve[PrimeOmega[n] == PrimeNu[n] ^ 2 - 5 && 0 < n < 100, n, Integers]Identify the PrimeOmega sequence:
PrimeOmega[Range[20]]FindSequenceFunction[%, n]Options (1)
GaussianIntegers (1)
Compute PrimeOmega over integers:
PrimeOmega[28]PrimeOmega[28, GaussianIntegers -> True]Applications (6)
Basic Applications (2)
Table of the values of PrimeOmega for the integers up to 100:
Multicolumn[Style[PrimeOmega[#], Bold]& /@ Range[100], 10, ...]Histogram of the values of PrimeOmega:
Histogram[PrimeOmega[Range[10 ^ 5]]]Number Theory (4)
Use PrimeOmega to test for a prime number:
isPrime[n_] := PrimeOmega[n] == 1isPrime[29]PrimeQ[29]Use PrimeOmega to compute LiouvilleLambda:
n = 48;
(-1) ^ PrimeOmega[48]LiouvilleLambda[n]Plot the average over values of PrimeOmega for different ranges of integer arguments:
lp = Mean /@ PrimeOmega[Table[Floor[Range[10 ^ i, 10 ^ (i + 1)]], {i, 1, 3, .1}]];
l = Partition[Riffle[Range[Length[lp]], lp], 2];
ListPlot[l]The Fourier statistics of the PrimeOmega sequence:
list = PrimeOmega[Range[10 ^ 4, 10 ^ 5]];
four = Fourier[list];
fchop = Cases[four, x_ /; Abs[x] < 0.5];
Histogram3D[Transpose[{Re[fchop], Im[fchop]}]]Properties & Relations (5)
Use FactorInteger to find the number of prime factors counting multiplicities:
Total[FactorInteger[100][[All, -1]]]PrimeOmega[100]PrimeOmega is a completely additive function:
PrimeOmega[24 40] == PrimeOmega[24] + PrimeOmega[40]PrimeOmega gives the exponent for a prime power:
PrimePowerQ[7 ^ 5]PrimeOmega[7 ^ 5]PrimeOmega and PrimeNu are equivalent when the argument is square-free:
SquareFreeQ[165]PrimeOmega[165] == PrimeNu[165]PrimeOmega is always greater than or equal to PrimeNu:
AllTrue[Range[100], PrimeOmega[#] ≥ PrimeNu[#]&]Possible Issues (1)
PrimeOmega is not defined at 0:
PrimeOmega[0]Neat Examples (2)
Plot the arguments of the Fourier transform of PrimeOmega:
ArrayPlot[Arg[Fourier[Table[PrimeOmega[m + n], {m, 200}, {n, 200}]]], ColorFunction -> Hue]Plot the Ulam Spiral of PrimeOmega:
ulam[n_] := Partition[Permute[Range[n ^ 2], Accumulate[Take[Flatten[{{n ^ 2 + 1} / 2, Table
[(-1) ^ j i, {j, n}, {i, {-1, n}}, {j}]}], n ^ 2]]], n];ArrayPlot[PrimeOmega[ulam[51]], ColorFunction -> "TemperatureMap"]See Also
Related Guides
History
Text
Wolfram Research (2008), PrimeOmega, Wolfram Language function, https://reference.wolfram.com/language/ref/PrimeOmega.html.
CMS
Wolfram Language. 2008. "PrimeOmega." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PrimeOmega.html.
APA
Wolfram Language. (2008). PrimeOmega. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PrimeOmega.html
BibTeX
@misc{reference.wolfram_2026_primeomega, author="Wolfram Research", title="{PrimeOmega}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/PrimeOmega.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_primeomega, organization={Wolfram Research}, title={PrimeOmega}, year={2008}, url={https://reference.wolfram.com/language/ref/PrimeOmega.html}, note=[Accessed: 12-June-2026]}