Jordan Totient Calculator
Compute the Jordan totient J(k,n), a power version of Euler's totient, from the prime factors of n.
What it does
The Jordan totients form a family of functions indexed by a positive integer k. At k = 1 the family gives Euler's totient, and higher values of k count ordered k tuples that together with n generate the whole space of residues. The functions are named after Camille Jordan, who introduced them in the nineteenth century.
The formula mirrors the product formula for Euler's totient, with powers inserted. Instead of n times the product of one minus one over p, we use n to the k times the product of one minus one over p to the k. When k is one the extra powers disappear and the familiar totient returns.
This page accepts k from one to five and n up to one million. It factors n, raises n to the chosen power using exact integer arithmetic, and applies one correction per distinct prime. The division at each step is exact because every prime divides n.
The result is shown together with the ordinary totient so you can see how the family grows with k. The factorization is printed as well, since the correction factors depend only on which primes appear, not on their exponents.
All values are exact integers with no rounding. Higher orders produce large numbers quickly, which is one reason the input limit is one million rather than the trillion used for simpler functions.
How to use
- Enter an integer n from 1 to 1,000,000.
- Enter an order k from 1 to 5.
- Read J(k, n) from the main result box.
- Compare it with the Euler totient shown beside it.
- The defaults n = 8 and k = 2 reproduce the worked example.
- Set k = 1 to check that the tool returns the ordinary totient.
Formula
- n
- The integer whose totient is being computed.
- k
- The order of the Jordan function, from 1 to 5.
- J(k, n)
- The Jordan totient of order k at n.
For n = 1 the value is 1 for every k. For a prime power p^a the formula reduces to p^(ak) minus p^((a-1)k), which at k = 1 becomes p^a minus p^(a-1), the ordinary totient of a prime power. The function is multiplicative, so values for coprime factors multiply.
Worked example
Example: J(2, 8)
The page opens with n = 8 and k = 2.
- Factor 8 as 2^3. The only distinct prime is 2.
- Raise n to the order: 8^2 = 64.
- Compute the correction for p = 2: 1 - 1/2^2 = 3/4.
- Multiply: 64 x 3/4 = 48.
- The tool reports 48 for J(2, 8).
- The Euler totient J(1, 8) is 4, shown beside it.
- A second check: J(2, 12) = 144 x 3/4 x 8/9 = 96.
Reference table
| n | Factorization | J(2, n) | J(1, n) |
|---|---|---|---|
| 1 | none | 1 | 1 |
| 4 | 2^2 | 12 | 2 |
| 8 | 2^3 | 48 | 4 |
| 12 | 2^2 x 3 | 96 | 4 |
| 16 | 2^4 | 192 | 8 |
| 30 | 2 x 3 x 5 | 576 | 8 |
Limits
- The order k is limited to 5 to keep results readable.
- Inputs above one million are rejected.
- The tool computes the integer value, not a count of residue tuples.
- Factorization precision limits the upper bound on n.
Common mistakes
- Raising each prime to k instead of the whole number n.
- Using exponents in the correction factor when only distinct primes matter.
- Expecting J(k, n) to divide n for every k.
- Forgetting that J(1, n) is Euler's totient.
- Rounding the intermediate fraction instead of dividing exactly.
Try it yourself
Quick checks. Answers sit tucked under each question.
What is J(2, 12)?
12^2 = 144, and the corrections are 3/4 and 8/9, so J(2, 12) = 96.
What is J(1, 12)?
At order one the value is Euler's totient, which is 4.
What is J(2, 8)?
8^2 x 3/4 = 48.
Questions
Who were the Jordan totients named after?
They are named after Camille Jordan, who introduced them as generalizations of Euler's totient.
What happens at k = 1?
The Jordan totient becomes the ordinary Euler totient.
Do prime exponents matter?
They affect the size of n^k, but the correction factor uses each distinct prime only once.
Is the function multiplicative?
Yes. Coprime inputs give values that multiply.
Are the results exact?
Yes. All powers and divisions use integer arithmetic.
What is the largest order?
Order five. Larger orders return a clear error.