Dedekind Psi Function Calculator
Compute the Dedekind psi value of an integer by multiplying prime powers by one plus the prime.
What it does
The Dedekind psi function is an arithmetic function named after Richard Dedekind. For an integer n it multiplies n by one plus one over each distinct prime divisor. Equivalently, each prime power in the factorization contributes that power divided by the prime, times the prime plus one.
The function has a concrete meaning in the theory of modular subgroups. It counts the index of a certain congruence subgroup of the modular group, which is where Dedekind encountered it. That geometric origin explains why the factor p plus one appears alongside the usual totient factor p minus one.
The relationship with Euler's totient is neat. Both are multiplicative, both depend only on the set of distinct primes in a multiplicative correction, and their product over the same prime gives p squared minus one. Where the totient subtracts one, psi adds one, so psi is always at least as large.
This page factors the input, applies the prime power rule and prints the result beside Euler's totient for the same number. The factorization is shown so each contribution can be verified by hand.
The input limit is one trillion. All arithmetic uses exact integers, and the tool returns a readable error outside the allowed range.
How to use
- Enter a whole number n from 1 upward.
- Read psi(n) from the main result box.
- Compare it with the Euler totient beside it.
- Use the factorization to check the prime power contributions.
- The default n = 12 reproduces the worked example.
- Try n = 30 to see three distinct prime corrections.
Formula
- n
- The positive integer being evaluated.
- p^a
- A prime power in the factorization of n.
- psi(n)
- The Dedekind psi value at n.
For a prime p the value is p plus one, while the totient is p minus one. For n = 1 there are no prime factors and both functions return 1. The function is multiplicative, so values for coprime inputs multiply, and the ratio psi(n) over phi(n) depends only on the distinct primes.
Worked example
Example: psi(12)
The page opens with n = 12.
- Factor 12 into 2^2 x 3.
- For 2^2 compute 2^(2-1) x (2 + 1) = 2 x 3 = 6.
- For 3^1 compute 3^(1-1) x (3 + 1) = 1 x 4 = 4.
- Multiply the contributions: 6 x 4 = 24.
- The tool reports psi(12) = 24 and totient 4.
- Check with the other form: 12 x 3/2 x 4/3 = 24.
- For 30 the same method gives 30 x 3/2 x 4/3 x 6/5 = 72.
Reference table
| n | Factorization | psi(n) | phi(n) |
|---|---|---|---|
| 1 | none | 1 | 1 |
| 2 | 2 | 3 | 1 |
| 8 | 2^3 | 12 | 4 |
| 12 | 2^2 x 3 | 24 | 4 |
| 30 | 2 x 3 x 5 | 72 | 8 |
| 36 | 2^2 x 3^2 | 72 | 12 |
Limits
- Only positive integers are accepted.
- Inputs above one trillion are rejected to keep factoring fast.
- The tool computes the integer value, not the subgroup count itself.
- The totient shown is independent and uses the same factorization.
Common mistakes
- Using p minus one where the formula needs p plus one.
- Letting prime exponents affect the correction factor.
- Assuming psi is smaller than the totient.
- Forgetting that psi(1) is 1.
- Multiplying corrections for repeated primes more than once.
Try it yourself
Quick checks. Answers sit tucked under each question.
What is psi(8)?
8 = 2^3, so psi(8) = 2^2 x 3 = 12.
What is psi(30)?
30 x 3/2 x 4/3 x 6/5 = 72.
What is psi(12)?
12 x 3/2 x 4/3 = 24, while phi(12) is 4.
Questions
Why is the function called psi?
Dedekind used the Greek letter psi for the subgroup index it describes.
How does it relate to the totient?
Both are multiplicative corrections by prime, but psi adds one where the totient subtracts one.
Is psi always larger?
It is at least as large, and strictly larger for every n greater than 2.
What is psi of a prime?
For prime p the value is p plus one.
Are the values exact?
Yes. Prime powers and products are computed with integer arithmetic only.
What input limit applies?
Whole numbers through one trillion, with an error for larger entries.