Modular Inverse Calculator
Calculate the modular inverse a⁻¹ mod m with the extended Euclidean algorithm. The inverse exists when a and m are coprime. Key in cryptography and number theory.
a⁻¹ mod m
—
Modular inverse: definition and algorithm
Take an integer a and a modulus n. Its modular inverse is the integer a⁻¹ that makes a · a⁻¹ ≡ 1 (mod n) hold. Such a value turns up exactly when gcd(a, n) = 1, and the extended Euclidean algorithm finds it quickly.
Take 3⁻¹ mod 7 = 5. It checks out because 3 · 5 = 15 = 2 · 7 + 1. Euler's theorem gives another route, a⁻¹ ≡ a^(φ(n)−1) (mod n), and if n = p happens to be prime, Fermat's little theorem simplifies that to a⁻¹ ≡ a^(p−2) (mod p).
Applications
- RSA, where the private key
dis just the inversee⁻¹ mod φ(n). - The Chinese Remainder Theorem (CRT), where combining residues leans on modular inverses.
- Cryptographic hashing and ECC arithmetic, both working over finite fields.
- Computer algebra, when you need to solve linear congruences like
a x ≡ b (mod n).
FAQ
When does the inverse fail to exist? Whenever gcd(a, n) > 1. Take 6 modulo 9: there is no inverse, since gcd(6, 9) = 3.
Is the inverse unique? Modulo n, yes. Exactly one representative falls in the range [0, n − 1].
Euclidean or Fermat, which is faster? The extended Euclidean algorithm handles any modulus and runs in O(log n). Fermat's shortcut only works when n is prime and relies on modular exponentiation; it is also O(log n), but the constants are bigger.
Related Tools
Inverse Square Law (Radiation)
Compute the radiation intensity at a new distance from a point source, I₂ = I₁·(d₁/d₂)², by the inverse square law: intensity falls with the square of distance. Doubling the distance reduces the dose to a quarter — which is why distance is one of the three basic radiation-protection defenses (time, distance and shielding) and the most effective and cheapest. Enter the initial intensity and distance and the new distance.
Concrete Creep Loss
Calculate the prestress loss from concrete creep, Δσ = φ·(E_s/E_c)·σ_cg, from the creep coefficient φ (dimensionless), the modular ratio E_s/E_c and the concrete stress at the tendon level from permanent loads σ_cg (MPa). Creep is the SLOW, growing deformation concrete undergoes under CONSTANT load over time: besides the immediate elastic shortening when compressed, concrete keeps shortening gradually for months and years, reaching a total deformation 2-3 times the initial elastic one. In a prestressed member, the concrete is PERMANENTLY compressed by the prestress, so it creeps (shortens slowly), and the bonded tendon shortens with it, LOSING tension — the largest time-dependent loss in many cases. The loss is the creep coefficient φ (typically 1.5-3.5, a function of humidity, loading age, member dimensions) times the equivalent elastic loss (modular ratio × concrete stress). With shrinkage and relaxation, creep defines the total time-dependent prestress loss. Estimating these losses well is crucial: underestimating leaves the member with less prestress than intended (cracking risk); overestimating wastes steel. Enter the creep coefficient, the modular ratio and the concrete stress.
Elastic Shortening Loss
Calculate the prestress loss from concrete elastic shortening, Δσ = (E_s/E_c)·σ_c, from the steel modulus E_s (MPa), the concrete modulus E_c (MPa) and the concrete stress at the tendon level σ_c (MPa). It is one of the IMMEDIATE prestress losses (at transfer, not over time): when the tendon is tensioned and anchored, it compresses the concrete, and the concrete, being compressed, SHORTENS elastically. Since the tendon is bonded or anchored in this shortened concrete, it shortens too — and shortening, it LOSES part of its tension. The loss is proportional to the modular ratio αe = E_s/E_c (typically 6-8, since steel is much stiffer than concrete) times the concrete compression stress at the tendon level. In members with SEVERAL tendons prestressed sequentially, each new tendon compresses and shortens the concrete, causing loss in already-anchored tendons — so the average loss is often taken as half the value (the first tendons lose more than the last). This is one of the losses to subtract from the initial force to get the effective prestressing force. Enter the steel and concrete moduli and the concrete stress.
Modular Exponentiation Calculator
Calculate modular exponentiation (b to the power e, modulo m) fast with the square-and-multiply method. Essential in RSA cryptography and number theory.
Typographic Modular Scale
Computes typographic modular scale using Fibonacci or golden ratio from body text.
Silo Asymptotic Pressure
Calculate the asymptotic (saturation) vertical pressure of a deep silo, p_∞ = (γ·D) ÷ (4·μ·K), from the product unit weight γ, diameter D, product-wall friction coefficient μ and lateral pressure ratio K. This is the LIMIT value the Janssen vertical pressure tends to at great depth — the maximum bottom pressure a silo can reach, however tall the stored product. It is Janssen's most striking result: while in a liquid pressure would grow without limit with height (p = γ·h), in granular product WALL FRICTION absorbs all added weight beyond a certain depth, making bottom pressure SATURATE. So a 30 m silo of grain may have a bottom pressure equal to only a few metres of product column. This asymptotic pressure is fundamental in design: it sets the maximum bottom and wall load the structure must bear, regardless of height, and explains why silos can be built slender and tall with relatively modest foundations. Note it is proportional to diameter and inversely proportional to friction — wide, smooth-walled silos generate higher pressures. Enter the unit weight, diameter, friction coefficient and lateral pressure ratio.
The results provided by this tool are for general informational and educational purposes only and do not constitute professional, financial, medical, legal, tax or accounting advice. Always confirm important decisions with a qualified professional and official sources.