{"uid":"cap_6DqUlpGdDAbQi-L3DGx_j","slug":"saylor-innovations-number-theory-toolkit-ee5eb539","name":"Saylor Innovations Number Theory Toolkit","description":"Number toolkit - primality, prime factorization, divisors, totient, perfect or abundant class, roman numeral, English words, bases and gcd or lcm with a second number","url":"https://saylorinnovations.com/api/math/number-theory?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["n"],"properties":{"m":{"type":"string","description":"optional second number for gcd and lcm"},"n":{"type":"string","description":"Whole number 0 to 9007199254740991"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","required":["n","is_prime","in_words"],"properties":{"n":{"type":"number","description":"The integer analysed"},"note":{"type":"string","description":"Caveat or context for reading the result"},"octal":{"type":["string","null"],"description":"Octal representation"},"binary":{"type":"string","description":"Binary representation"},"source":{"type":"string","description":"Data source the values come from"},"with_m":{"type":"object","properties":{"m":{"type":["number","null"],"description":"Second number supplied"},"gcd":{"type":["number","null"],"description":"Greatest common divisor with m"},"lcm":{"type":["number","null"],"description":"Least common multiple with m"},"coprime":{"type":["boolean","null"],"description":"True when n and m share no factor"}},"description":"With m"},"is_even":{"type":["boolean","null"],"description":"True when this is even"},"in_words":{"type":"string","description":"In words"},"is_prime":{"type":"boolean","description":"True when this is prime"},"digit_sum":{"type":"number","description":"Digit sum"},"next_prime":{"type":["number","null"],"description":"Next prime"},"aliquot_sum":{"type":["number","null"],"description":"Aliquot sum"},"digit_count":{"type":["number","null"],"description":"Number of digit"},"divisor_sum":{"type":["number","null"],"description":"Divisor sum"},"hexadecimal":{"type":"string","description":"Hexadecimal representation"},"digital_root":{"type":["number","null"],"description":"Digital root"},"divisor_count":{"type":["number","null"],"description":"Number of divisor"},"euler_totient":{"type":["number","null"],"description":"Euler totient"},"is_palindrome":{"type":["boolean","null"],"description":"True when this is palindrome"},"prime_factors":{"type":["array","null"],"description":"Prime factors"},"roman_numeral":{"type":["string","null"],"description":"Roman numeral"},"classification":{"type":["string","null"],"description":"Classification assigned by the source"},"previous_prime":{"type":["number","null"],"description":"Previous prime"},"is_perfect_cube":{"type":["boolean","null"],"description":"True when this is perfect cube"},"is_power_of_two":{"type":["boolean","null"],"description":"True when this is power of two"},"is_perfect_square":{"type":"boolean","description":"True when this is perfect square"},"prime_factorization":{"type":["string","null"],"description":"Prime factorization"},"distinct_prime_factors":{"type":["number","null"],"description":"Distinct prime factors"}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_UdSyhFwYOEqGnqjhky3Yg","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Analyzes a whole number and returns primality, factorization, divisors, totient, number class, roman numeral, English words, base representations, and optionally GCD/LCM with a second number","exampleAgentPrompt":"Is 104729 a prime number, and can you also give me its prime factorization, Euler totient, and English word form — and while you're at it, what's the GCD and LCM of 104729 and 360?","exampleUseCases":[{"title":"Verify primality for cryptographic key","prompt":"Check whether 15485863 is prime, and if not, give me its prime factorization and the next prime above it."},{"title":"Compute GCD and LCM for fraction simplification","prompt":"What is the greatest common divisor and least common multiple of 144 and 60? Also tell me if they're coprime."},{"title":"Convert number to roman numerals and words","prompt":"Give me the roman numeral and English word spelling for 2024, plus whether it's a perfect, abundant, or deficient number."}],"resultDescription":"A JSON object containing: the integer n, its English word form, primality boolean, prime factors, list of divisors, Euler totient, aliquot and divisor sums, number class (perfect/abundant/deficient), roman numeral, binary/octal/hexadecimal representations, digit count and digit sum, next prime, and optionally a with_m block containing GCD, LCM, and coprimality with a second number m.","failureModes":["Missing required parameter n returns an error","n outside range 0–9007199254740991 returns a validation error","Non-integer or non-numeric n causes a parse error","Very large n near the maximum may have limited factorization accuracy","GCD/LCM fields are null when m is not provided"],"whenToPreferThis":"Choose this endpoint when you need comprehensive number-theoretic properties of a single integer — primality, factorization, divisors, totient, classification, and multiple base representations — all in one call rather than calling separate specialized APIs. Especially useful when you also need GCD/LCM against a second number simultaneously.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-18T12:53:12.521Z","isFirstParty":false,"canonicalSlug":"saylor-innovations-number-theory-toolkit-ee5eb539"}