ForHosting KIT · Developer Utilities

Sequence Term from Explicit Formula Calculator

This sequence term from explicit formula calculator evaluates a formula in n at the exact index you choose.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Enter an expression such as 3n^2 - 2n + 5, supply the desired value of n, and receive the corresponding term without building a table by hand. It supports standard arithmetic, parentheses, implicit multiplication, useful constants, and common mathematical functions. The calculation is deterministic and checks invalid syntax, undefined division, unsupported names, and non-finite results before returning a value.

Enter the explicit rule and the index

An explicit sequence formula describes a term directly from its index. Instead of calculating every earlier value, you provide the rule in terms of n and the one index you want. For example, the formula <code>3n^2 - 2n + 5</code> can be evaluated at <code>n = 4</code> immediately. Use ordinary operators for addition, subtraction, multiplication, division, remainder, and powers. Parentheses control grouping, while forms such as <code>2n</code> and <code>3(n+1)</code> use implicit multiplication. The calculator accepts nonnegative integer indices, including zero, so it works for sequences whose authors start counting at either zero or one. Enter the indexing convention used by your source rather than automatically shifting the position. The returned object repeats the normalized formula and index alongside the term, making it easy to verify exactly what was evaluated or preserve the result in a larger workflow. A formula must contain <code>n</code> only when its value actually depends on the index; constant sequences are valid too.

Understand supported notation and evaluation

Powers use the caret, so write <code>n^2</code> rather than relying on programming-language syntax. The constants <code>pi</code> and <code>e</code> are available, as are <code>abs</code>, <code>sqrt</code>, <code>floor</code>, <code>ceil</code>, <code>round</code>, <code>sin</code>, <code>cos</code>, <code>tan</code>, <code>ln</code>, <code>log</code>, <code>exp</code>, <code>pow</code>, <code>min</code>, and <code>max</code>. Trigonometric arguments are measured in radians, <code>ln</code> is the natural logarithm, and <code>log</code> is base ten. Exponentiation is evaluated from right to left, and unary signs follow conventional mathematical precedence, so <code>-2^2</code> means the negative of two squared. The evaluator tokenizes the expression and applies a mathematical grammar; it never runs the formula as JavaScript or another general-purpose language. Results must be finite numbers. Consequently, division by zero, a square root outside the real-number domain, excessive exponent growth, and malformed expressions are rejected instead of producing a misleading value such as infinity or not-a-number.

Check the result and avoid indexing mistakes

The most common mistake in sequence questions is not arithmetic but indexing. A textbook may call the first term <code>a_1</code>, while a programming exercise may begin with <code>a_0</code>. This calculator substitutes the exact integer you enter and does not reinterpret it as an ordinal position. If a prompt asks for the tenth term of a sequence defined for <code>n = 1, 2, 3, ...</code>, enter 10. If it defines the first stored element at index zero and asks for the element at index 10, enter 10 without adding one. Review the echoed formula and index before using the returned term. Decimal results use standard JavaScript number precision, which is suitable for ordinary classroom and application calculations but is not arbitrary-precision symbolic mathematics. Very large powers or domain errors are deliberately refused when they cannot produce a finite numeric result. For automated use, each request has a base price of $0.002. Because the same deterministic solver powers interactive and API execution, identical valid inputs produce the same output shape and value in both channels.

Check a homework term

Substitute the requested index into a polynomial, exponential, or trigonometric explicit rule and verify the arithmetic.

Generate a single forecast point

Evaluate a known index-based model at one period without calculating all preceding periods.

Validate sequence code

Compare an application-generated term with a deterministic evaluation of the documented explicit formula.

What notation can I use for powers?

Use the caret: write n^2 for n squared and 2^n for a power with n as the exponent.

Can the sequence start at zero?

Yes. The index n may be any integer from 0 through 1,000,000, and it is substituted exactly as entered.

Does it support implicit multiplication?

Yes. Expressions such as 2n, 3(n+1), and n(n-1) are interpreted as multiplication.

Which logarithms are available?

Use ln(x) for the natural logarithm and log(x) for the base-ten logarithm.

Why was my formula rejected?

The syntax may be malformed, a name or function may be unsupported, an operation may be outside the real-number domain, or the result may not be finite.

How much does an API calculation cost?

Each API request costs $0.002. The browser calculator uses the same deterministic calculation logic.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/algebra/sequence-term-from-formula

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/algebra/sequence-term-from-formula \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"formula":"3n^2 - 2n + 5","n":4}'
{
  "formula": "3n^2 - 2n + 5",
  "n": 4
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "algebra.sequence_term_from_formula",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_chars500
max_index1000000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →