Number Utilities

Is Perfect Number

Validates whether a number is perfect — where the sum of its proper divisors equals the original number. Use via MCP in Cursor or Windsurf, or call GET /v1/number/is-perfect with your number. Returns true for classics like 6 (1+2+3=6) and 28. Perfect numbers are rare mathematical gems that AI agents can now identify deterministically.

API Endpoint

GET /v1/number/is-perfect

Code Examples

curl "https://tinyfn.io/v1/number/is-perfect" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/number/is-perfect', {
  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/is-perfect',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

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"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

What is a perfect number and how does this tool identify them?

A perfect number equals the sum of its proper divisors (excluding itself). For example, 6 = 1+2+3. The tool calculates all divisors and checks if they sum to the original number.

How can I use this in my MCP-enabled editor to check perfect numbers?

In Cursor, Claude Code, or Windsurf, the AI agent can call this tool directly when you ask about perfect numbers. It returns a boolean result plus the divisor breakdown for verification.

What are some examples of perfect numbers I can test?

Try 6, 28, 496, and 8128 — these return true. Most numbers like 12 or 100 return false since their proper divisors don't sum to the original value.

Does this work with large numbers or is there a limit?

The tool handles reasonable integer ranges efficiently. Very large numbers may timeout due to divisor calculation complexity, but it works fine for typical mathematical exploration.

How is this different from just calculating divisors myself?

This provides instant, deterministic validation without manual calculation errors. Perfect for mathematical verification, educational tools, or when AI agents need reliable number theory results.

Try Is Perfect Number Now

Get your free API key and start using Is Perfect Number in seconds.

Get Free API Key