Number Utilities

Nth Cube

Calculates the nth cube number (n³) for any positive integer. Use via MCP in AI coding assistants or REST API at `/v1/number/cube`. For example, the 5th cube number is 125 (5³). Perfect for mathematical computations, sequence generation, and volume calculations where you need precise cubic values without manual computation.

API Endpoint

GET /v1/number/cube

Code Examples

curl "https://tinyfn.io/v1/number/cube" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/number/cube', {
  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/cube',
    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

How do I get the 10th cube number using this tool?

Pass n=10 to get 1000 (10³). The tool returns the exact cubic value for any positive integer input.

What's the difference between nth cube and cube root?

Nth cube calculates n³ (5 becomes 125), while cube root finds what number cubed gives you the input (125 becomes 5).

Can I use this in MCP tools like Cursor for generating cube sequences?

Yes, MCP integration lets AI agents call this tool directly to generate cube sequences, verify cubic calculations, or solve math problems requiring precise cube values.

What happens if I pass 0 or negative numbers?

The tool accepts any integer. 0³ returns 0, and negative numbers work correctly ((-3)³ = -27).

What's the largest cube number this tool can calculate?

Limited by standard integer precision, typically up to very large values before overflow. For most practical applications, it handles any reasonable input size.

Try Nth Cube Now

Get your free API key and start using Nth Cube in seconds.

Get Free API Key