nth Pell Number

Return P(n) exactly with P(0)=0, P(1)=1, and P(n)=2P(n−1)+P(n−2); the index is capped at 10,000.

Description

Pell numbers follow a recurrence that doubles the preceding term before adding the term before it.

Pell numbers follow a recurrence that doubles the preceding term before adding the term before it. Their exact integers grow rapidly with the index.1

The tool returns value. The indexing and output conventions below determine how to read these values.

When to use nth Pell Number

Use this for the following task: Return P(n) exactly with P(0)=0, P(1)=1, and P(n)=2P(n−1)+P(n−2); the index is capped at 10,000. Use the input and output conventions below to reproduce the intended mathematical quantity.

How to use nth Pell Number and understand its results

  1. Choose the required indexes, integers or sequence entries. Preserve decimal-string encodings where the field table specifies strings.
  2. Enter n according to the field table, then run the tool.
  3. Read value. Preserve exact decimal strings and the stated indexing or coefficient order.
  4. Keep exact decimal strings for subsequent integer arithmetic; distinguish them from any explicitly approximate numeric result.
Input fieldMeaningValue type and boundsRequirement
nZero-indexed term (resource limit 10000)integer; minimum 0; maximum 10000Required

Advance a pair of BigInt values from zero and one for n iterations. Return the selected term as a decimal string.

P(0)=0; P(1)=1; P(n)=2P(n−1)+P(n−2)

The symbols and boundary conditions refer to the supplied fields and the implementation described above.

Output fieldMeaningValue type
valuePell numberstring (integer/arbitrary)
json
{
  "input": {
    "n": 10
  },
  "output": {
    "value": "2378"
  }
}

Limitations and assumptions

The index is zero-based and at most 10000. The tool does not solve a caller-supplied Pell equation or return a floating approximation.

Use the declared integer bounds and string formats. Large exact outputs remain decimal strings; numerical approximations use ordinary floating-point arithmetic. A rejected input is different from a valid zero count or false membership flag.

Alternative or Complementary methods

Choose nth Fibonacci Number when you need its operation: Return F(n) exactly as a decimal string with F(0)=0 and F(1)=1; the index is capped at 100,000 for bounded computation. Choose nth Lucas Number for the complementary operation: Return L(n) exactly as a decimal string with L(0)=2 and L(1)=1; the index is capped at 100,000 for bounded computation.

Background reference: OEIS A000129.

References

  1. OEIS A000129 — OEIS Foundation

Similar or alternative tools

  • nth Fibonacci Number

    Return F(n) exactly as a decimal string with F(0)=0 and F(1)=1; the index is capped at 100,000 for bounded computation.

  • nth Lucas Number

    Return L(n) exactly as a decimal string with L(0)=2 and L(1)=1; the index is capped at 100,000 for bounded computation.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies