# agent402.tools Prime Factorization

> agent402.tools Prime Factorization is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Computes the prime factorization of an integer (up to 10^15) via trial division, returning prime factors, a readable factorization string, primality, and distinct factor count.

## Facts

- Endpoint: POST https://agent402.tools/api/prime-factorize
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-prime-factorization-80753d9b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_huKc-mr4qVwfPxaMnc33_

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 agent402-tools-prime-factorization-80753d9b -d '<json body>'
```

Example prompt: What is the prime factorization of 720720 — tell me the list of prime factors with repeats, the factorization string, whether it's prime, and how many distinct primes it has.

## When to prefer this

Use this endpoint when you need to factorize a specific integer up to 10^15 and want both the raw list of prime factors and a formatted human-readable string, plus primality and distinct factor count in a single call. Prefer this over a general math API when you need trial-division factorization for number theory tasks, cryptographic analysis, or educational purposes.

## Known failure modes

- Number exceeds 10^15 limit — request rejected
- Number is 1 or less — invalid input
- Non-integer value supplied — schema validation error
- Payment not included or insufficient — 402 Payment Required
- Network timeout on very large near-prime numbers near the limit

## How this service works

Find the prime factorization of an integer via trial division. Returns the list of prime factors (with repeats), a human-readable factorization string, whether the number is prime, and the count of distinct prime factors. Limit: numbers up to 10^15.

## Output

Returns a list of prime factors (with repetition), a human-readable factorization string (e.g. '2^4 × 3^2 × 5'), a boolean indicating whether the input is prime, and the count of distinct prime factors.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "number": {
   "type": "integer",
   "description": "Integer > 1 to factorize (max 10^15)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "number": 360,
  "factors": [
   2,
   2,
   2,
   3,
   3,
   5
  ],
  "isPrime": false,
  "factorization": "2^3 × 3^2 × 5",
  "distinctFactors": 3
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-prime-factorization-80753d9b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
