number_theory_operation
Test primality, factor integers, find the next prime, and compute gcd or lcm for large integers.
Instructions
Number theory: primality testing, integer factorisation, the next prime above n, gcd and lcm. Prefer this over evaluate_sage for any of these.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | Primary integer. Pass values above 2^53 as a decimal STRING: JSON numbers are IEEE doubles in JavaScript-based clients, so 10^30 arrives as 1000000000000000019884624838656 and the answer is silently wrong. | |
| b | No | Second integer, required for gcd and lcm. Same string rule. | |
| session | No | Named workspace to use. Workspaces have independent variables; omit for 'default'. | default |
| operation | Yes | Operation: 'is_prime', 'factor_integer', 'next_prime', 'gcd', 'lcm' |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||