# Prime Factorization and Number Theory Analysis

> Prime Factorization and Number Theory Analysis is a paid API for AI agents from math-stats.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-29).

Performs primality testing and prime factorization of integers up to 10^19, returning factors, divisor count, divisor sum, Euler totient, and number type classification.

## Facts

- Endpoint: GET https://math-stats.x402tookit.com/prime-factor?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/prime-factorization-and-number-theory-analysis-24870f29
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_kI1x1nQUiSogNrJ_IyuQi

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability prime-factorization-and-number-theory-analysis-24870f29
```

Example prompt: Can you factorize 9007199254740997 and tell me if it's prime, along with its Euler totient, divisor count, and number type?

## When to prefer this

Use this endpoint when you need rigorous number-theoretic properties — primality, factorization, totient, divisor statistics — for integers up to 10^19. Prefer it over general-purpose math libraries when you need a hosted, pay-per-call solution with structured JSON output covering multiple number properties in a single call. Particularly valuable for cryptographic validation, competitive programming assistance, and educational tools.

## Known failure modes

- n out of range (below 2 or above 10^19) returns error or null fields
- non-integer or missing n parameter causes validation failure
- very large semi-primes near 10^19 may trigger degraded mode with partial results
- network timeout for computationally intensive inputs

## How this service works

Primality test and prime factorization of integers up to 10^19, with divisor count, divisor sum, Euler totient and number type.

## Output

Returns the integer n, a list of prime factors with their exponents, a formatted factorization string, whether n is prime, the count and sum of all divisors, the aliquot sum, the Euler totient, the number type classification (e.g. prime, perfect, abundant, deficient), a square-free flag, count of distinct primes, and optional degraded/disclaimer fields indicating any limitations.

## Request schema (JSON Schema)

```json
{
 "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": {
      "n": {
       "type": "integer",
       "description": "Integer from 2 to 10^19"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "n": {
       "type": [
        "null",
        "string"
       ]
      },
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "factors": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "object",
        "properties": {
         "prime": {
          "type": [
           "null",
           "string"
          ]
         },
         "exponent": {
          "type": [
           "null",
           "number"
          ]
         }
        }
       }
      },
      "isPrime": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "totient": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "aliquotSum": {
       "type": [
        "null",
        "string"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "divisorSum": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "numberType": {
       "type": [
        "null",
    
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/prime-factorization-and-number-theory-analysis-24870f29/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from math-stats.x402tookit.com](https://www.zero.xyz/host/math-stats.x402tookit.com/llms.txt)
