Number theory calculations by mode
Use this calculator for six integer calculations: Greatest common factor, Least common multiple, Prime factorization, Modular arithmetic, Factorial, and Permutations & combinations. Results use exact JavaScript BigInt arithmetic where applicable.
How to use the calculator
- Select a mode and enter the values shown for it.
- In Modular arithmetic, choose an operation from Operation. Enter
bwhen the exponent field appears. - In Permutations & combinations, select Without repetition or With repetition.
- Select Calculate to display the exact result and generated calculation details.
- Select Copy result or Download result (.txt) to keep the result as plain text. Select Reset to clear the fields and hide the current result.
Mode-specific inputs and controls
- Greatest common factor and Least common multiple accept two or more comma- or space-separated integers. Each list accepts at most 50 integers. GCF accepts zero if at least one value is nonzero; LCM rejects any list containing zero. Negative signs are ignored for these calculations.
- Prime factorization accepts one integer with up to 15 digits. Zero has no prime factorization. For negative input, the calculator factors the absolute value and reports the sign separately.
- Modular arithmetic uses Operation for
a mod n, additive inverse, multiplicative inverse, or modular exponentiation. The modulusncannot be zero, and exponentbmust be nonnegative when shown. A multiplicative inverse exists only whenGCF(a, n) = 1. - Factorial accepts a nonnegative integer from 0 to 10,000. It returns
0! = 1for zero. - Permutations & combinations accepts nonnegative
nandrvalues from 0 to 10,000 and returns both results for the selected repetition setting. Without repetition,r > ngives 0 for both.
Calculation details and limitations
The result includes formulas and generated calculation details, but it does not list every underlying trial divisor or operation.
- Factorial multiplication is expanded through 15 terms. For larger inputs, the chain is abbreviated; the result and digit count are still shown.
- Modular exponentiation uses repeated squaring and reports the number of squaring steps rather than every multiplication.
- Prime factorization records the prime factors found by trial division, not every divisor tested.
- GCF, LCM, and modular arithmetic accept integers up to 100 digits. Factorials, permutations, and combinations use the 10,000 limit stated above.
- For negative modular inputs,
a mod nreturns a result with the sign ofnor zero. Additive inverse is normalized using the absolute value of the modulus.
Privacy and calculator processing
The arithmetic is implemented in JavaScript on this page. The local implementation does not document broader analytics or telemetry handling, so this page makes no claim about whether other page information is sent to a server.
Frequently asked questions
What operations does this calculator support?
Six modes: greatest common factor (GCF/GCD), least common multiple (LCM), prime factorization, modular arithmetic (mod, additive inverse, multiplicative inverse, modular exponentiation), factorials, and permutations/combinations. Pick a mode and enter the values for that calculation.
Are the results exact, or rounded approximations?
The calculator uses exact integer arithmetic with JavaScript BigInt where applicable. Results are not rounded to a fixed decimal precision.
How does it handle zero and negative numbers?
GCF accepts zero when at least one value is nonzero, while GCF(0, 0) is rejected. LCM lists containing zero are rejected, and zero has no prime factorization. Negative values are accepted in several integer modes; factorial, permutations, and combinations require nonnegative values. For modular arithmetic, a mod n follows the sign of n, while additive inverse uses the absolute modulus.
What are the size limits, and why do they exist?
GCF, LCM, and modular arithmetic accept integers up to 100 digits, and each GCF or LCM list accepts at most 50 integers. Prime factorization accepts numbers up to 15 digits. Factorials, permutations, and combinations accept values up to 10,000.