Calculates the nth triangular number using the formula n(n+1)/2. Access via MCP in Cursor or Windsurf for instant mathematical computations, or call GET /v1/number/triangular with parameter n. Returns precise results for sequence problems, combinatorics, and algorithmic challenges without manual calculation errors.
curl "https://tinyfn.io/v1/number/triangular" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/number/triangular', {
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/triangular',
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"
}
}
}
}
A triangular number is the sum of consecutive integers from 1 to n (1+2+3+...+n). The nth triangular number equals n(n+1)/2, so the 5th triangular number is 5×6/2 = 15.
Yes, the MCP tool handles arbitrarily large integers without overflow issues. Perfect for mathematical analysis, algorithm verification, or generating test data in your development environment.
Send GET /v1/number/triangular?n=10 to get the 10th triangular number (55). Returns JSON with the result and handles edge cases like n=0 returning 0.
Triangular numbers represent combinations C(n+1,2) - the number of ways to choose 2 items from n+1 items. Useful for counting pairs, graph edges, or handshake problems.
Zero returns 0 (valid triangular number), while negative inputs typically return an error. The sequence is undefined for negative integers in standard mathematical contexts.
Get your free API key and start using Nth Triangular in seconds.
Get Free API Key