AM + BN GCD Identity Calculator

Explore Bezout identities for integer pairs. Review Euclidean steps, coefficients, checks, inverses, and related outputs. Download exact records instantly for study and review today.

Calculator Inputs

Formula Used

This calculator uses Bezout's identity: am + bn = gcd(m,n).

The extended Euclidean algorithm finds integers a and b. If one solution is a₀ and b₀, all solutions are:

a = a₀ + k(n/g), b = b₀ - k(m/g), where g = gcd(m,n) and k is any integer.

For a custom target c, the equation am + bn = c has an integer solution only when gcd(m,n) divides c.

How to Use This Calculator

  1. Enter integer values for m and n.
  2. Leave the target blank to solve am + bn = gcd(m,n).
  3. Enter a target value to solve am + bn = c.
  4. Use k to generate another valid coefficient pair.
  5. Press Calculate to view the result above the form.
  6. Download the CSV or PDF report when needed.

Example Data Table

m n gcd a b Check
252 198 18 4 -5 4(252) + -5(198) = 18
99 78 3 -11 14 -11(99) + 14(78) = 3
17 43 1 -5 2 -5(17) + 2(43) = 1
-120 23 1 9 47 9(-120) + 47(23) = 1
0 15 15 0 1 0(0) + 1(15) = 15

Understanding the Identity

The expression am + bn = gcd(m, n) is called Bezout's identity. It says that the greatest common divisor of two integers can be written as a linear combination of those integers. The numbers a and b are Bezout coefficients. They are not usually unique. Once one pair is known, infinitely many pairs can be created.

Why This Calculator Helps

Manual Euclidean work is simple for small values, yet it can become long. This calculator uses the extended Euclidean algorithm. It finds the gcd first. Then it traces backward through the same divisions to find valid coefficients. The tool also checks the final identity. That check is useful when the input numbers are negative, large, or mixed with zero.

Advanced Uses

Bezout coefficients are important in number theory. They support modular inverses, congruence solving, Diophantine equations, and cryptography lessons. When gcd(m, n) equals one, the coefficient of m gives the inverse of m modulo n. The coefficient of n gives the inverse of n modulo m. This calculator reports those inverses when they exist.

Target Values

The normal identity equals the gcd. Sometimes you may want am + bn to equal another target value. An integer solution exists only when the target is divisible by the gcd. The calculator can scale the base coefficients when that condition is true. It also lets you choose a parameter k. That parameter creates another valid pair from the infinite solution family.

Reading the Results

The result card shows the gcd, one coefficient pair, the selected k pair, the identity check, the lcm, and optional inverses. The Euclidean table lists quotient and remainder steps. These rows explain how the gcd was produced. The solution family shows how every integer coefficient pair is related to the first pair.

Best Practice

Use whole numbers for m and n. Negative values are allowed. Avoid entering both values as zero for meaningful number theory work. After calculating, download the CSV for spreadsheet records. Use the PDF button for a printable report. The example table gives starter pairs for testing. Compare those examples with your own inputs to build confidence. For teaching, copy the step rows into notes and explain each quotient slowly before checking answers carefully.

FAQs

What does am + bn = gcd(m,n) mean?

It means the greatest common divisor of m and n can be written as a sum of two integer multiples of those numbers.

What are a and b?

They are Bezout coefficients. They multiply m and n to produce the greatest common divisor through a linear combination.

Are a and b unique?

No. If one pair works, many other pairs can work. The k value generates another valid pair from the solution family.

Can I use negative integers?

Yes. The calculator accepts negative values for m and n. It adjusts coefficient signs and checks the final identity.

What happens if one input is zero?

The calculator still works when only one value is zero. The gcd becomes the absolute value of the non-zero input.

Why is a target value included?

The target lets you solve am + bn = c. A solution exists only when c is divisible by gcd(m,n).

When does a modular inverse exist?

A modular inverse exists when the two numbers are coprime. That means their gcd equals one.

What is the CSV download for?

The CSV download saves inputs, results, and Euclidean steps. It is useful for records, lessons, and spreadsheet review.

Related Calculators

Paver Sand Bedding Calculator (depth-based)Paver Edge Restraint Length & Cost CalculatorPaver Sealer Quantity & Cost CalculatorExcavation Hauling Loads Calculator (truck loads)Soil Disposal Fee CalculatorSite Leveling Cost CalculatorCompaction Passes Time & Cost CalculatorPlate Compactor Rental Cost CalculatorGravel Volume Calculator (yards/tons)Gravel Weight Calculator (by material type)

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.