Prime Factors decomposes integers into their constituent prime numbers using trial division. Access via MCP in Cursor or Windsurf, or call GET /v1/number/factors directly. Input 60, get [2, 2, 3, 5]. Returns factors in ascending order with repetition for powers — essential for cryptography, algorithm optimization, and mathematical analysis where deterministic factorization matters.
curl "https://tinyfn.io/v1/number/factors" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/number/factors', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/number/factors',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's number tools:
{
"mcpServers": {
"tinyfn-number": {
"url": "https://tinyfn.io/mcp/number",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Returns a JSON array of prime factors in ascending order with repetition. For example, 12 returns [2, 2, 3], and 17 returns [17].
Agents can factor numbers for cryptographic key analysis, algorithm complexity calculations, or mathematical problem solving. Integrates directly with Cursor and other MCP-enabled editors.
Handles standard integers efficiently, but very large numbers may timeout due to computational complexity. Prime factorization becomes exponentially harder with larger inputs.
Typically returns empty array for 1, and handles 0 and negatives according to mathematical conventions. Check specific error responses for boundary conditions.
Provides consistent, deterministic results across platforms without requiring math libraries. Useful when you need reliable factorization in web APIs or cross-language workflows.
Get your free API key and start using Prime Factors in seconds.
Get Free API Key