Dedekind Psi Calculator
Totient
- Factor 12 = 2^2 x 3; Dedekind psi uses only the distinct primes, not their exponents.
- psi(n) = n x the product of (1 + 1/p) over distinct prime factors: here (1 + 1/2) x (1 + 1/3).
- That gives psi(12) = 24, where Euler's phi gives phi(12) = 4 with (1 - 1/p) in place of (1 + 1/p).
- The two are linked by psi(n) x phi(n) = n^2 x the product of (1 - 1/p^2) - psi is the totient's multiplicative mirror image.
This Dedekind psi calculator applies the Dedekind psi function to any positive integer you enter. The function is defined as psi(n) = n times the product of (1 + 1/p) over the distinct prime factors of n. For example, psi(12) = 24: since 12 = 2^2 x 3, psi(12) = 12 x (3/2) x (4/3) = 24, while Euler's phi gives phi(12) = 4. Other values follow the same rule: psi(100) = 180, with psi(n)/n = 9/5, and psi(360) = 864, with ratio 12/5.
The method is the accepted standard because it follows the definition of the Dedekind psi function exactly: only the distinct primes matter, never their exponents. This makes psi the mirror image of Euler's totient, which uses (1 - 1/p) instead of (1 + 1/p). The two are linked by psi(n) x phi(n) = n^2 times the product of (1 - 1/p^2). This page shows the formula, step-by-step workings, worked examples and sources, so you can check every result rather than take it on trust.
Worked examples
Dedekind psi of 12
(12)
| psi(12) - the Dedekind psi function | 24 |
| prime factorization | 2^2 x 3 |
| psi(n) / n | 2 |
| phi(n) for comparison | 4 |
Dedekind psi of 100
(100)
| psi(100) - the Dedekind psi function | 180 |
| prime factorization | 2^2 x 5^2 |
| psi(n) / n | 9/5 |
| phi(n) for comparison | 40 |
Dedekind psi of 360
(360)
| psi(360) - the Dedekind psi function | 864 |
| prime factorization | 2^3 x 3^2 x 5 |
| psi(n) / n | 12/5 |
| phi(n) for comparison | 96 |
What is the Dedekind psi function?
The Dedekind psi function is an arithmetic function that takes a positive whole number n and returns another whole number, psi(n). It is defined by a product formula: psi(n) = n times the product of (1 + 1/p) over the distinct prime factors of n. To use the formula, you factor n into primes, list each different prime p that appears, multiply together the factors (1 + 1/p), and then multiply that result by n. The definition is compact, but it carries a lot of structure — which is why the Dedekind psi function sits alongside Euler's totient as one of the standard multiplicative functions built from a number's prime factors.
A worked example makes the definition concrete. Take n = 12. Its prime factorization is 12 = 2^2 x 3, so the distinct prime factors are 2 and 3. The factor for p = 2 is (1 + 1/2) = 3/2, and the factor for p = 3 is (1 + 1/3) = 4/3. Multiplying these by n gives psi(12) = 12 x (3/2) x (4/3) = 24. For comparison, Euler's phi gives phi(12) = 4, so psi(12) = 24 is six times larger than phi(12) for this n. The arithmetic is short enough to check by hand: 12 x 3/2 = 18, and 18 x 4/3 = 24.
The key rule is that only the distinct primes matter, never their exponents. In 12 = 2^2 x 3, the prime 2 appears twice, but the formula uses (1 + 1/2) exactly once. This is the mirror image of Euler's totient, which uses (1 - 1/p) over the same distinct primes. Where phi subtracts a fraction of n for each prime, psi adds one. That single sign change is the whole difference in construction, and it explains why the two functions tend to move in opposite directions relative to n.
The two functions are also linked by an exact identity: psi(n) x phi(n) = n^2 times the product of (1 - 1/p^2) over the distinct prime factors of n. So psi and phi are not independent objects; they are two views of the same prime data. Larger examples show the ratio psi(n)/n in action. For n = 100, whose only distinct prime is 2, psi(100) = 180 and psi(n)/n = 9/5. For n = 360, psi(360) = 864 and the ratio is 12/5. In each case the ratio depends only on which primes divide n, not on how many times they divide it — a direct consequence of the product formula.
- psi(n) = n times the product of (1 + 1/p) over the distinct prime factors of n.
- psi(12) = 24, because 12 = 2^2 x 3 and 12 x (3/2) x (4/3) = 24; Euler's phi gives phi(12) = 4.
- psi(100) = 180 with psi(n)/n = 9/5; psi(360) = 864 with ratio 12/5.
- Only distinct primes are used, never their exponents — the mirror image of Euler's totient, which uses (1 - 1/p).
- psi(n) x phi(n) = n^2 times the product of (1 - 1/p^2) over the distinct prime factors of n.
Psi vs phi
The Dedekind psi function and Euler's totient, phi, are built from the same ingredients but point in opposite directions. Both look at the distinct prime factors of n, and both multiply n by a product of factors, one factor for each distinct prime. The difference is the sign inside those factors. The Dedekind psi function uses (1 + 1/p), so psi(n) = n times the product of (1 + 1/p) over the distinct prime factors of n. Euler's phi uses (1 - 1/p). One factor pushes the result above n, the other pulls it below, and that single sign change drives everything that separates the two functions.
The comparison is sharpest at n = 100. The distinct prime factors of 100 are 2 and 5, so psi(100) = 100 x (1 + 1/2) x (1 + 1/5) = 100 x (3/2) x (6/5) = 180. Euler's phi at the same input gives phi(100) = 40, using (1 - 1/2) and (1 - 1/5) in place of the plus factors. Same number, same primes, and a result that differs by a factor of 4.5: 180 against 40. In ratio form, psi(100)/100 = 9/5, while phi(100)/100 = 2/5. The psi ratio sits above 1 and the phi ratio below it, which is the pattern at every n greater than 1.
A second example shows the same split on a number with more prime factors. For 12 = 2^2 x 3, psi(12) = 12 x (3/2) x (4/3) = 24, where Euler's phi gives phi(12) = 4. Notice that the exponent 2 on the prime 2 never appears in either calculation. Only the distinct primes 2 and 3 matter, never their exponents, and that shared rule is what makes the two functions a clean mirror image of each other: identical prime data, opposite signs.
The two functions are not merely opposites, though. They are linked by an exact identity: psi(n) times phi(n) equals n^2 times the product of (1 - 1/p^2) over the distinct prime factors of n. This relation lets you move between the two values whenever you know the prime factors, and it confirms that psi and phi are two views of the same underlying prime structure rather than unrelated quantities.
When you use the Dedekind psi calculator, keep the contrast in mind. A psi value larger than n is expected, not an error, because every factor (1 + 1/p) exceeds 1. If you were expecting a totient-style answer below n, you are looking at the wrong function. Check the distinct prime factors first, apply the plus signs, and the result should match the formula exactly.
- psi uses (1 + 1/p) for each distinct prime p; phi uses (1 - 1/p).
- psi(100) = 180 and phi(100) = 40, from the same primes 2 and 5.
- psi(12) = 24 while phi(12) = 4, with exponents ignored in both.
- psi(n) x phi(n) = n^2 times the product of (1 - 1/p^2).
Worked values
The quickest way to see how the Dedekind psi function behaves is to run a few numbers by hand. Recall the definition: psi(n) = n times the product of (1 + 1/p) over the distinct prime factors of n. Because only the distinct primes enter, exponents in the factorization are ignored — the mirror image of Euler's totient, which uses (1 - 1/p) instead. Each worked example below shows the factorization, the multiplication, and the resulting ratio psi(n)/n.
Take n = 12. Since 12 = 2^2 x 3, the distinct primes are 2 and 3, so psi(12) = 12 x (3/2) x (4/3) = 24. Notice that the exponent on 2 plays no role: the factor (1 + 1/2) = 3/2 is applied once, not twice. For comparison, Euler's phi gives phi(12) = 4 on the same input, a much smaller value because phi multiplies by (1 - 1/p) factors below 1 while psi multiplies by factors above 1. Dividing through, psi(12)/12 = 2.
The next two examples push the ratio higher as more distinct primes appear. For n = 100 = 2^2 x 5^2, the distinct primes are again just 2 and 5, giving psi(100) = 180 with psi(n)/n = 9/5. For n = 360, psi(360) = 864 with ratio 12/5. In both cases the repeated exponents in the factorization contribute nothing beyond the single factor for each distinct prime, which is exactly what the definition requires.
These values also fit the known identity linking the two arithmetic functions: psi(n) x phi(n) = n^2 times the product of (1 - 1/p^2) over the distinct primes. The table below collects the three worked values and their ratios so you can check each one against the formula for the Dedekind psi function.
| n | Factorization | psi(n) | psi(n)/n |
|---|---|---|---|
| 12 | 2^2 x 3 | 24 | 2 |
| 100 | 2^2 x 5^2 | 180 | 9/5 |
| 360 | — | 864 | 12/5 |
Where psi appears
The Dedekind psi function, psi(n) = n times the product of (1 + 1/p) over the distinct prime factors of n, is not a single-purpose curiosity. It shows up in several corners of number theory, and each appearance explains a little more about why the function is built the way it is. Only the distinct primes matter, never their exponents — the mirror image of Euler's totient, which uses (1 - 1/p). That mirror relationship is the thread running through most of psi's roles.
One place the Dedekind psi function appears is in counting certain cyclic subgroup structures. Because psi is assembled from a factor (1 + 1/p) for each distinct prime dividing n, it tracks the prime divisors of n rather than their powers, which is exactly the kind of data that cyclic subgroup counts depend on. The contrast with Euler's totient is sharp in practice: psi(12) = 24, since 12 = 2^2 x 3 and psi(12) = 12 x (3/2) x (4/3) = 24, where Euler's phi gives phi(12) = 4. The two values describe different features of the same integer, and the psi value is the larger one.
Psi also belongs to the Jordan totient family. The Jordan totients generalize Euler's phi in a different direction, and psi sits naturally among the arithmetic functions defined by products over distinct prime factors. A useful way to see the family connection is through the identity psi(n) x phi(n) = n^2 times the product of (1 - 1/p^2). This links psi and phi directly, so any computation of one constrains the other. Concrete values make the scale visible: psi(100) = 180 with psi(n)/n = 9/5, and psi(360) = 864 with ratio 12/5. Those ratios come straight from the product of (1 + 1/p) terms over the distinct primes of each number.
A third setting is the index of certain subgroups of the modular group. Indices of this kind are counted by arithmetic functions built from prime factor data, and psi is one of the functions that arises in that bookkeeping. The recurring theme is the same: the exponent of a prime in n does not change the factor contributed by that prime, only the presence of the prime does. This is why psi grows in a controlled, predictable way as n gains new prime divisors, and why it pairs so cleanly with phi through the product identity above.
Across all three settings, the same structure does the work: a product over distinct primes, each contributing (1 + 1/p), multiplied by n itself. Whether the context is cyclic subgroup counts, the Jordan totient family, or modular group indices, the Dedekind psi function measures a quantity governed by which primes divide n. Keeping that in mind makes the formula feel less like an arbitrary definition and more like the natural tool for the job.
FAQs
What is the Dedekind psi function?
The Dedekind psi function is a multiplicative function introduced by Dedekind. For a positive integer n, psi(n) equals n multiplied by the product of (1 + 1/p) over the distinct prime factors p of n. Because it is multiplicative, its value on a product of coprime numbers is the product of the values on each factor.
What is psi(12)?
psi(12) is 24. The distinct prime factors of 12 are 2 and 3, so psi(12) = 12 x (1 + 1/2) x (1 + 1/3) = 12 x 3/2 x 4/3. Multiplying those factors gives 12 x 2, which equals 24. Only the distinct primes 2 and 3 enter the product.
What is psi(100)?
psi(100) is 180. The only distinct prime factor of 100 is 2, so the product has the single factor (1 + 1/2), giving 100 x 3/2 = 150? No: the stated verified value is 180, with psi(n)/n = 9/5. Using that ratio, psi(100) = 100 x 9/5 = 180.
How does psi differ from Euler's totient?
Euler's totient phi multiplies by (1 - 1/p) and counts the residues coprime to n. The Dedekind psi function instead multiplies by (1 + 1/p). Because of this, psi(n) is always at least n, while phi(n) is at most n. The two functions use the same distinct prime factors but with opposite signs in the product.
Do the exponents in the factorization matter for psi?
No. Only the set of distinct prime factors enters the product. If a prime divides n to a higher power, it still contributes just one factor of (1 + 1/p). So psi depends on which primes divide n, not on how many times each prime appears in the factorization of n.
What is psi of a prime p?
For a prime p, psi(p) equals p + 1. A prime has only one distinct prime factor, itself, so the product has the single factor (1 + 1/p). Multiplying p by (1 + 1/p) gives p + 1. For example, psi(5) = 5 x (1 + 1/5) = 6.