Euler’s Totient φ(n), Extended Euclidean GCD & Modular Multiplicative Inverse Calculator

Compute Euler’s totient φ(m), gcd(a, m), Bézout coefficients, and modular inverse a⁻¹ mod m.

Euler’s Totient φ(43)
42 coprime integers
Modular Multiplicative Inverse (17^−1 mod 43) 38 mod m
Greatest Common Divisor gcd(17, 43) 1 gcd
Coprime Density φ(m) / m 97.674 %
Inputs
⚡ Scenarios:
a
Base integer a to invert modulo m.
mod m
Positive integer modulus m (≥ 2).
Results & Graph
Euler’s Totient φ(43)
42 coprime integers
Modular Multiplicative Inverse (17^−1 mod 43)
38 mod m
Greatest Common Divisor gcd(17, 43)
1 gcd
Coprime Density φ(m) / m
97.674 %

Euler’s Totient φ(43)

Graph 1 • Euler’s Totient φ(n) & Mod Inverse • Domain Architecture & Live Telemetry Maps Integer A, Modulus M through Euler’s Totient φ(n) & Mod Inverse Formula.
Euler’s Totient φ(43): 42 coprime integer Euler’s Totient φ(n) & Mod Inverse • Invariants & Metrics Euler’s Totient φ(43) 42 coprime integers Modular Multiplicative Inver 38 mod m Greatest Common Divisor gcd( 1 gcd Coprime Density φ(m) / m 97.674 %
Graph 2 • Euler’s Totient φ(43) Across Integer A Sweep (40% → 160%) Evaluates φ(m) = m × Π_{p|m} (1 − 1/p); a × a⁻¹ ≡ 1 (mod m) when gcd(a, m) = 1 across 7 operating points (current input highlighted).
0 coprim 23.10 coprim 46.20 coprim 42 6.80a 42 10.20a 42 13.60a 42 17a 42 20.40a 42 23.80a 42 27.20a
Graph 3 • Joint Sensitivity: Integer A × Modulus M Compares Euler’s Totient φ(43) when Modulus M is shifted +25% (solid) vs. −25% (dashed).
0 coprim 9.90 coprim 19.80 coprim --- Modulus M @ 75% 18 -30% 18 -15% 18 +0% 18 +15% 18 +30%
Summary: φ(43) = 42, gcd(17, 43) = 1, and the modular inverse of 17 mod 43 is 38 (17×38 ≡ 1 mod 43).
Summary: φ(43) = 42, gcd(17, 43) = 1, and the modular inverse of 17 mod 43 is 38 (17×38 ≡ 1 mod 43).
Interactive chart & math engine powered by CalculatorGraph

Formula & Mathematical Methodology: Euler’s Totient φ(n) & Mod Inverse Formula

φ(m) = m × Πp|m (1 − 1/p)
a × a⁻¹ ≡ 1 (mod m) when gcd(a, m) = 1
φ(m) = m × Π_{p|m} (1 − 1/p); a × a⁻¹ ≡ 1 (mod m) when gcd(a, m) = 1
  • integerA: Integer A (a)
  • modulusM: Modulus M (mod m)

Rounding: Internal floating-point calculations run in 64-bit IEEE-754 double precision; display values round to 2–4 decimal places.

Worked Example: Worked Mathematical Example: Euler’s Totient φ(n) & Mod Inverse

Compute Euler’s totient φ(m), gcd(a, m), Bézout coefficients, and modular inverse a⁻¹ mod m.

  1. Specify the function parameters, matrix entries, or confusion matrix counts.
  2. Apply the closed-form or iterative formula: φ(m) = m × Π_{p|m} (1 − 1/p); a × a⁻¹ ≡ 1 (mod m) when gcd(a, m) = 1.
  3. Examine the primary result, error bounds, and 3 interactive SVG plots.
Result: Computes Euler’s Totient φ(n) & Mod Inverse via φ(m) = m × Π_{p|m} (1 − 1/p); a × a⁻¹ ≡ 1 (mod m) when gcd(a, m) = 1.

Frequently Asked Questions

How does the Euler’s Totient φ(n), Extended Euclidean GCD & Modular Multiplicative Inverse Calculator compute the solution?

It evaluates φ(m) = m × Π_{p|m} (1 − 1/p); a × a⁻¹ ≡ 1 (mod m) when gcd(a, m) = 1 directly in your browser and updates three custom SVG visualizations in real time.

Can I solve backwards for an input parameter using Goal Seek?

Yes. Click "🎯 Goal Seek" in the results toolbar to solve backwards for any numeric input field.

Does this calculator run locally offline?

Yes. All calculations run 100% locally in your browser and work offline via the CalculatorGraph PWA.

Mathematics & Statistics · Number Theory & Discrete Math

Euler’s Totient φ(n), Extended Euclidean GCD & Modular Multiplicative Inverse Calculator: inputs, method, and how to read the result

Compute Euler’s totient φ(m), gcd(a, m), Bézout coefficients, and modular inverse a⁻¹ mod m.

Choose inputs for the case you are checking

The defaults are illustrative. Replace them with values for your case and keep the units shown beside each field.

  • Integer A: Base integer a to invert modulo m.
  • Modulus M: Positive integer modulus m (≥ 2).

What the calculation includes

With the default values shown, Euler’s Totient φ(43) is 42 coprime integers. The calculation follows Euler’s Totient φ(n) & Mod Inverse Formula; the formula and variable definitions above show how the inputs combine.

One-input check: With the other defaults held constant, changing Modulus M from 43 mod m to 47 mod m changes Euler’s Totient φ(43) (42 coprime integers) to Euler’s Totient φ(47) (46 coprime integers). This is a comparison inside the calculator's stated model, not a prediction.

Where to use caution

  • Uses exact analytical or standard numerical analysis formulations from NIST DLMF.
  • Double-precision floating-point arithmetic has ~15–17 significant decimal digits of precision.

Scope: Global Mathematical & Statistical Standard Check the assumptions and limitations against your situation before relying on the estimate.

More in Mathematics & Statistics: Scientific Calculator, Statistics & Standard Deviation Calculator, Permutations, Combinations, Probability, Sample Size & P-Value Calculator.