PrimeNu[n]
gives the number of distinct primes
in n.
PrimeNu
PrimeNu[n]
gives the number of distinct primes
in n.
Details and Options
- Integer mathematical function, suitable for both symbolic and numerical manipulation.
- PrimeNu gives the number of distinct prime factors.
- For a number
with
a unit and
primes, PrimeNu[n] returns m. - With the setting GaussianIntegers->True, PrimeNu gives the number of Gaussian prime factors.
- PrimeNu[m+In] automatically works over Gaussian integers.
Examples
open all close allBasic Examples (2)
Scope (9)
Numerical Evaluation (4)
Symbolic Manipulation (5)
TraditionalForm formatting:
PrimeNu[n]//TraditionalFormReduce[PrimeNu[n] ^ 2 + n == n + 1 && 20 < n < 30, n, Integers]Solve[5PrimeNu[n] == n ^ 2 - 4 && 0 < n < 1000, n, Integers]Identify the PrimeNu sequence:
PrimeNu[Range[20]]FindSequenceFunction[%, n]Dirichlet generating function of 2^PrimeNu:
Sum[2 ^ PrimeNu[k] / k ^ s, {k, 1, Infinity}]Compare with DirichletTransform:
DirichletTransform[2 ^ PrimeNu[n], n, s]Options (1)
GaussianIntegers (1)
Compute PrimeNu over integers:
PrimeNu[30]PrimeNu[30, GaussianIntegers -> True]Applications (7)
Basic Applications (2)
Number Theory (5)
Use PrimeNu to test for a prime power:
PrimeNu[32]PrimePowerQ[32]Use PrimeNu to compute MoebiusMu and LiouvilleLambda for square-free numbers:
SquareFreeQ[42]MoebiusMu[42] == (-1) ^ PrimeNu[42]LiouvilleLambda[42] == (-1) ^ PrimeNu[42]PrimeNu is related to MoebiusMu through the following formula:
With[{n = 24}, DivisorSum[n, Abs[MoebiusMu[#]]&] == 2 ^ PrimeNu[n]]Plot the average over values of PrimeNu for different ranges of integer arguments:
lp = Mean /@ PrimeNu[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 PrimeNu sequence:
list = PrimeNu[Range[10 ^ 4, 10 ^ 5]];
four = Fourier[list];
fchop = Cases[four, x_ /; Abs[x] < 0.5];
Histogram3D[Transpose[{Re[fchop], Im[fchop]}]]Properties & Relations (6)
Use FactorInteger to find the number of distinct prime factors:
Length[FactorInteger[50]]PrimeNu[50]PrimeNu is an additive function:
PrimeNu[9 40] == PrimeNu[9] + PrimeNu[40]PrimeNu gives 1 for a prime power:
PrimePowerQ[49]PrimeNu[49]PrimeNu and PrimeOmega are equivalent when the argument is square free:
SquareFreeQ[210]PrimeNu[210] == PrimeOmega[210]PrimeNu is always smaller than or equal to PrimeOmega:
AllTrue[Range[100], PrimeNu[#] ≤ PrimeOmega[#]&]If n is square free, PrimeNu is related to MoebiusMu and LiouvilleLambda:
SquareFreeQ[33]MoebiusMu[33] == (-1) ^ PrimeNu[33]LiouvilleLambda[33] == (-1) ^ PrimeNu[33]Possible Issues (1)
PrimeNu is not defined at 0:
PrimeNu[0]Neat Examples (2)
Plot the arguments of the Fourier transform of PrimeNu:
ArrayPlot[Arg[Fourier[Table[PrimeNu[m + n], {m, 200}, {n, 200}]]], ColorFunction -> Hue]Plot the Ulam spiral of PrimeNu:
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[PrimeNu[ulam[51]], ColorFunction -> "TemperatureMap"]Related Guides
History
Text
Wolfram Research (2008), PrimeNu, Wolfram Language function, https://reference.wolfram.com/language/ref/PrimeNu.html.
CMS
Wolfram Language. 2008. "PrimeNu." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PrimeNu.html.
APA
Wolfram Language. (2008). PrimeNu. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PrimeNu.html
BibTeX
@misc{reference.wolfram_2026_primenu, author="Wolfram Research", title="{PrimeNu}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/PrimeNu.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_primenu, organization={Wolfram Research}, title={PrimeNu}, year={2008}, url={https://reference.wolfram.com/language/ref/PrimeNu.html}, note=[Accessed: 12-June-2026]}