/v1/totient
Euler totient
Try it live
10 free calls per day — no sign-up, no API key. Goes through the oanor gateway.
It works. Grab an API key and use it in your project.
Get an API keyCode snippets
curl "https://api.oanor.com/modular-api/v1/totient" \ -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/modular-api/v1/totient", {
headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/modular-api/v1/totient");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
"https://api.oanor.com/modular-api/v1/totient",
headers={"x-oanor-key": "oanor_test_..."}
)
Example response
A real response from this endpoint, captured by the latest health check.
{
"data": {
"note": "Euler's totient φ(n) counts the integers in 1..n coprime to n. For gcd(a,n)=1, a^φ(n) ≡ 1 (mod n) (Euler's theorem).",
"inputs": {
"n": "36"
},
"totient": "12",
"euler_check": {
"a": "5",
"coprime": true,
"a_pow_phi_mod_n": "1"
},
"prime_factorization": [
{
"prime": "2",
"exponent": 2
},
{
"prime": "3",
"exponent": 2
}
]
},
"meta": {
"timestamp": "2026-06-04T18:38:00.695Z",
"request_id": "9390e275-8e49-4442-b060-1ebaceefb5dc"
},
"status": "ok",
"message": "Euler totient",
"success": true
}