# Euler Totient Function φ(n) Calculator

Exact φ(n) from trial-division factorization (n ≤ 10¹²) with optional coprime listing and Euler's theorem recall.

> Canonical page: https://elysiatools.com/en/tools/euler-totient-function

- **Category:** Math & Numbers

- **Keywords:** euler totient, phi function, euler's theorem, coprime, relatively prime, prime factorization, number theory, multiplicative

## Overview

The Euler Totient Function φ(n) Calculator computes the exact count of positive integers up to n that are relatively prime to n for any integer up to 10¹². Using trial-division factorization, it outputs the prime factors, calculates φ(n) using Euler's product formula, recalls Euler's theorem, and can optionally list the first 60 coprime integers.

## Inputs

- **Number n** (text): Positive integer, 1 ≤ n ≤ 10¹² (trial-division factorization bound).
- **Output detail** (select)

## When to use

- Determining the order of multiplicative groups in modular arithmetic and abstract algebra.
- Solving number theory problems involving coprimality and Euler's totient theorem.
- Analyzing modulus properties and key spaces in RSA or other cryptographic algorithms.

## How it works

- Enter a positive integer n within the range 1 ≤ n ≤ 10¹².
- Select the desired output detail to view either the factorization and φ(n) value or include a list of coprime numbers.
- The tool performs prime factorization using trial division to identify all distinct prime factors of n.
- It applies Euler's product formula φ(n) = n · Π(1 − 1/p) to generate the exact totient value along with Euler's theorem statement.

## Use cases

- Mathematics students verifying modular arithmetic assignments and prime factorization steps.
- Cryptography learners exploring key generation mechanics and Euler's totient relations.
- Programmers and contest participants validating number theory algorithms against exact φ(n) outputs.

## Frequently asked questions

### What is Euler's totient function φ(n)?

Euler's totient function φ(n) counts the number of positive integers from 1 to n that share no common positive divisors with n other than 1 (i.e., gcd(a, n) = 1).

### What is the maximum number supported by this calculator?

The calculator supports any positive integer n such that 1 ≤ n ≤ 10¹².

### How does the tool calculate φ(n) for prime numbers?

For any prime number p, all preceding positive integers are coprime to p, so the totient evaluates directly to φ(p) = p − 1.

### How many coprime numbers can the tool display in list mode?

When the list mode is enabled, the tool displays up to the first 60 coprime integers.

### What is Euler's theorem stated in the results?

Euler's theorem states that if gcd(a, n) = 1, then a raised to the power of φ(n) is congruent to 1 modulo n (a^φ(n) ≡ 1 mod n).

## Related tools

- [Carmichael Function λ(n) Calculator](https://elysiatools.com/en/tools/carmichael-function): Group exponent λ(n) from prime factorization with φ(n) comparison, primitive-root existence, Korselt's Carmichael-number detection, and optional sample-unit verification.
- [Chinese Remainder Theorem Solver (System of Congruences)](https://elysiatools.com/en/tools/chinese-remainder-theorem): Generalized pairwise-merge CRT for 2–20 congruences: coprime moduli give the product modulus, consistent non-coprime moduli give the lcm, inconsistent systems are rejected.
- [Permutation / Combination / Subset Generator (With Repeats)](https://elysiatools.com/en/tools/combinatorial-generation): Deduplicated, lexicographic permutations / combinations / subsets of up to 12 items with exact multiset counts; display capped at 200 entries.
- [Zero-Sum Game Solver (Saddle Point / Linear Programming)](https://elysiatools.com/en/tools/game-theory-zero-sum): Two-person zero-sum games: saddle-point test first, then mixed strategies from a single-phase simplex LP with dual shadow prices, verified by security-level checks.
- [Inverse Laplace Transform Calculator (Partial Fractions)](https://elysiatools.com/en/tools/inverse-laplace-calculator): Partial-fraction inverse Laplace transform for proper rational functions: root factorization (real + conjugate pairs), exact coefficient system, term-by-term inversion.
- [Laplace Transform Calculator (Table Lookup)](https://elysiatools.com/en/tools/laplace-transform-calculator): Table lookup of L{f(t)} for 14 standard pairs, with parameter substitution, region of convergence, derivation note, and optional numeric F(s₀) evaluation.
- [Multiplicative Order Calculator mod n (ordₙ(a))](https://elysiatools.com/en/tools/order-of-element-mod-n): Smallest k with a^k ≡ 1 (mod n) via φ(n) reduction: power table, minimality proof, cyclic subgroup , primitive-root and maximal-order flags.
- [Partial Fraction Decomposer (Rational Functions)](https://elysiatools.com/en/tools/partial-fraction-decomposer): Decompose N(x)/D(x) into A/(x−r)^j + (Bx + C)/((x−α)² + β²) with long division for improper fractions and numeric residual verification.

## Samples

- [Web Image Processing Python Samples](https://elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion
- [Web Image Processing Rust Samples](https://elysiatools.com/en/samples/web-image-processing-rust): Web Rust image processing examples including image read/save, scaling, and format conversion
