math_gcd_lcm_calculator
Compute GCD and LCM of integers with all reduction steps, or prime-factorize a number into prime-exponent pairs.
Instructions
GCD / LCM Calculator and Prime Factorizer. Compute the greatest common divisor (GCD) and least common multiple (LCM) of a list of integers, or prime-factorize a single integer. GCD/LCM use the pairwise Euclidean algorithm (BigInt-backed so LCM never overflows) and return every reduction step; factorize uses trial division and returns prime/exponent pairs plus a pretty string. Set operation to gcd, lcm, or factorize. Use this for number-theory reductions; use math_prime_number_checker for primality/next-prime, math_factorial_calculator for n!/nPr/nCr, and math_bitwise_calculator for bit operations. Runs locally on the numbers you provide: read-only, non-destructive, contacts no external service, and is rate-limited (60 requests/minute for anonymous callers). Returns the result value plus the worked steps (GCD/LCM) or factor list (factorize).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operation | Yes | Which computation to run: gcd or lcm (require numbers) or factorize (requires n). | |
| numbers | No | Required for gcd/lcm: 2 to 32 integers. GCD rejects an all-zero list; LCM rejects any zero. String digits like "12" are accepted and coerced. | |
| n | No | Required for factorize: a single integer from 2 to 10^12 (1000000000000) to prime-factorize. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | No | Whether the computation succeeded. | |
| result | No | Operation output. gcd/lcm/factorize each populate different fields. | |
| error | No | Present only on failure: the validation/computation error message. |