¿Es número primo?
is-primePrueba la primalidad con Miller-Rabin determinista hasta 3,3·10^24 y devuelve los primos siguiente y anterior. Cuándo: un resultado numérico tiene que ser exacto o reproducible y no estimado. No para: factorizar un entero (prime-factorize). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.
EN: Tests primality with deterministic Miller-Rabin for integers up to 3.3·10^24 (number or decimal string) and returns the next and previous primes. When: a numeric result has to be exact or reproducible instead of estimated. Not for: factorizing an integer up to 10^20 into primes (prime-factorize). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"n": "<n>"
},
"name": "is-prime"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | Yes | Integer (integer or string; required; up to 25 chars; pattern ^-?\d{1,24}$). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | ||
| is_prime | No | ||
| next_prime | No | ||
| previous_prime | No |