Enter one integer to compute the totient and factors. View coprimes, residues, and calculation notes. Export neat results for revision, teaching, and quick verification.
For a positive integer n with distinct prime factors p1, p2, ..., pk:
φ(n) = n × (1 - 1/p1) × (1 - 1/p2) × ... × (1 - 1/pk)
If n = pk, then:
φ(pk) = pk - pk-1 = pk(1 - 1/p)
This works because the formula removes multiples of each distinct prime factor from the count between 1 and n.
| n | Prime Factorization | φ(n) | Coprime Preview |
|---|---|---|---|
| 1 | 1 | 1 | 1 |
| 2 | 2 | 1 | 1 |
| 9 | 32 | 6 | 1, 2, 4, 5, 7, 8 |
| 10 | 2 × 5 | 4 | 1, 3, 7, 9 |
| 12 | 22 × 3 | 4 | 1, 5, 7, 11 |
| 15 | 3 × 5 | 8 | 1, 2, 4, 7, 8, 11, 13, 14 |
Euler's totient function counts integers that are relatively prime to a chosen number. This page helps you find that value fast. It also shows factorization details and a coprime preview. That makes it useful for study, checking work, and classroom practice.
The totient function appears in number theory often. It helps describe modular arithmetic and residue classes. It also supports ideas used in cryptography. When you know φ(n), you know how many positive integers up to n share no common factor with n except one. That single count reveals useful structure inside the number.
The calculator first factors the input integer into prime powers. Then it applies Euler's product rule. For n with distinct prime factors p, the rule is φ(n) = n × ∏(1 - 1/p). This method is faster than checking every smaller number one by one. The page still can list coprimes for inspection when you want a practical view.
The result area reports the totient value, prime factorization, formula expansion, and a ratio check. It can also show a reduced residue preview. That helps you see which values remain coprime to n. The summary is useful for homework checks, contest practice, and teaching examples.
Many learners understand the topic better when they see both the formula and the actual coprime values. This page gives both views together. You can compare the factorization with the final answer. You can also inspect small cases and spot patterns. For example, prime inputs always return one less than the input. Prime powers follow a clean repeated pattern too.
This tool is also handy for building examples in class notes. The exports help you save results. The simple layout keeps the focus on the calculation.
Use it when solving modular arithmetic problems. Use it when studying prime powers or multiplicative functions. It also fits quick verification before exams. The example data table below gives sample outputs for common inputs. The formula section explains the rule in plain language. The steps stay short and clear, so the page remains easy to scan.
It counts how many integers from 1 through n are relatively prime to n. In other words, each counted value shares no common factor with n except 1.
If p is prime, every number from 1 to p - 1 is coprime to p. None of those smaller values share p as a factor.
Yes. By standard convention, φ(1) = 1. The count includes the integer 1, which is relatively prime to 1.
Yes. The totient function is not one to one. For example, several different inputs can produce the same count of coprime integers.
Factoring makes the product formula efficient. Once the distinct prime factors are known, the totient value can be computed much faster than checking every smaller integer.
It lets you inspect actual integers that are relatively prime to n. This is helpful for learning, checking patterns, and verifying smaller examples by hand.
Yes. Totients are common in modular arithmetic, reduced residue systems, and related number theory exercises. Seeing the count and the coprimes together can be very useful.
The page supports positive integers within your server's integer range. Extremely large values may take longer, especially if you also request a long coprime preview.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.