Pell Number Calculator
Find the Pell number at any index from its two term recurrence, with the previous value and the ratio shown.
What it does
The Pell numbers begin 0, 1, 2, 5, 12, 29 and continue by a simple rule. Each term is twice the term before it plus the term before that. The sequence looks like a cousin of the Fibonacci numbers, but the factor of two changes its growth rate and the problems it solves.
The numbers are named after John Pell, though the credit is historical rather than precise. They appear in approximations to the square root of two, in the side lengths of almost isosceles right triangles, and in the solutions of a family of equations known as Pell equations.
Because the rule uses only earlier terms, computing P(n) is straightforward. Start from the two initial values and walk forward, keeping the last two numbers at each step. No division or rounding is required, so even P(200) is printed as an exact integer with dozens of digits.
This page reports the Pell number at your index, the previous Pell number and the ratio between them. The ratio quickly settles near 2.414, which is one plus the square root of two, the characteristic root of the recurrence.
The index limit is 200. That is enough to show the long term growth clearly while keeping the displayed result short enough to read in one line.
How to use
- Enter an index n from 0 to 200.
- Read P(n) from the main result box.
- Check the previous term beside it.
- Read the ratio to see the growth settling toward 2.414.
- The default index 5 reproduces the worked example.
- Try index 10 to confirm the value 2,378.
Formula
- n
- The index in the sequence, starting at zero.
- P(n)
- The Pell number at index n.
- P(n - 1)
- The immediately preceding term, doubled in the recurrence.
The characteristic equation is x squared minus two x minus one equals zero, with roots one plus the square root of two and one minus the square root of two. The larger root controls the growth, so the ratio of consecutive terms approaches 2.41421356. The exact value at index n is the difference of the two root powers divided by twice the square root of two.
Worked example
Example: P(5)
The page is set to index 5 on first load.
- Start with P(0) = 0 and P(1) = 1.
- Compute P(2) = 2 x 1 + 0 = 2.
- Compute P(3) = 2 x 2 + 1 = 5.
- Compute P(4) = 2 x 5 + 2 = 12.
- Compute P(5) = 2 x 12 + 5 = 29.
- The tool reports 29, previous value 12, and ratio 2.42x.
- Continuing gives P(10) = 2,378, as a second check.
Reference table
| n | P(n) | Previous | Ratio |
|---|---|---|---|
| 0 | 0 | n/a | n/a |
| 1 | 1 | 0 | n/a |
| 2 | 2 | 1 | 2.00x |
| 3 | 5 | 2 | 2.50x |
| 4 | 12 | 5 | 2.40x |
| 5 | 29 | 12 | 2.42x |
| 10 | 2378 | 985 | 2.41x |
Limits
- The sequence is defined for nonnegative indices only.
- Indices above 200 are rejected to keep the result short.
- The ratio is rounded to two decimals and is not an exact value.
- The tool returns a single term, not the companion Pell numbers.
Common mistakes
- Using the Fibonacci recurrence with a coefficient of one instead of two.
- Starting from P(0) = 1 instead of 0.
- Assuming the ratio equals the golden ratio rather than one plus the square root of two.
- Rounding intermediate terms when computing by hand.
- Treating the index as the value of the term.
Try it yourself
Quick checks. Answers sit tucked under each question.
What is P(10)?
P(10) = 2,378, with P(9) = 985 before it and a ratio of 2.41.
What is P(5)?
P(5) = 2 x 12 + 5 = 29.
What is P(4)?
P(4) = 2 x 5 + 2 = 12.
Questions
Is this the same as the Fibonacci sequence?
No. Fibonacci uses one times the previous term, while Pell uses two, so Pell grows faster.
Why is the ratio near 2.414?
That is one plus the square root of two, the dominant root of the recurrence equation.
Where do Pell numbers appear?
In rational approximations to the square root of two and in integer solutions of related equations.
What is P(0)?
It is zero, which is why the ratio is not defined at the very start.
Are the values exact?
Yes. Only integer addition and multiplication are used.
What index limit does this page use?
Two hundred, with an error message for anything larger.