Math Utilities

Is Fibonacci

Determines if a given number belongs to the Fibonacci sequence using `/v1/math/is-fibonacci`. Returns true/false with mathematical validation rather than guessing. Essential for sequence analysis in AI agents through MCP in Cursor or Windsurf, plus mathematical applications requiring precise Fibonacci identification.

API Endpoint

GET /v1/math/is-fibonacci

Code Examples

curl "https://tinyfn.io/v1/math/is-fibonacci" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/is-fibonacci', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/math/is-fibonacci',
    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 math tools:

{
  "mcpServers": {
    "tinyfn-math": {
      "url": "https://tinyfn.io/mcp/math",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How does the Fibonacci checker determine if a number is in the sequence?

Uses the mathematical property that n is Fibonacci if one of (5n²+4) or (5n²-4) is a perfect square.

What's the largest Fibonacci number this tool can validate?

Depends on implementation limits, but typically handles numbers up to JavaScript's MAX_SAFE_INTEGER (2^53-1).

Can I check negative numbers or zero with the Fibonacci validator?

Yes, zero is Fibonacci (F₀=0). Negative Fibonacci numbers exist in the extended sequence (negafibonacci).

How do MCP-enabled editors use this for mathematical validation?

AI agents can verify Fibonacci properties in code analysis, data validation, or mathematical proofs without calculating the entire sequence.

What's the difference between this and generating Fibonacci sequences?

This validates membership without computation overhead—faster than generating sequences up to the target number.

Try Is Fibonacci Now

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

Get Free API Key