/v1/totient
Euler totient
Essayez-le en direct
10 appels gratuits par jour — sans inscription, sans clé API. Passe par la passerelle oanor.
Ça marche. Récupérez une clé API et utilisez-la dans votre projet.
Obtenez une clé APIExtraits de code
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_..."}
)
Exemple de réponse
Une réponse réelle de ce endpoint, capturée lors du dernier contrôle de santé.
{
"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
}