Pell Number Calculator
This Pell number calculator works out any term in the Pell sequence, a lesser-known relative of the Fibonacci numbers that turns up in number theory and the study of irrational numbers. The sequence begins 0, 1, and each new term is found by doubling the previous term and adding the one before that, giving 0, 1, 2, 5, 12, 29, 70, 169 and onwards. You simply enter the index n, from 0 to 1000, and the calculator returns three things: the Pell number itself, labelled P(n), the previous Pell number in the sequence, and the index you entered for reference. Because Pell numbers grow very quickly, the tool uses exact big integer arithmetic rather than ordinary decimal maths, so even the largest terms in the range come back precise and correctly grouped for easy reading, with no rounding errors creeping in. Beyond curiosity value, Pell numbers matter because their ratios give some of the best whole number approximations to the square root of two, and the sequence is bound up with the silver ratio and with solutions to Pell's equation, a classic problem in number theory. It is a handy tool for students checking coursework, programmers testing recursive or iterative implementations, and anyone exploring integer sequences. The recurrence relation, a worked example and the full assumptions behind the calculation are set out below the results.
The formula
The Pell numbers are defined by P(0) = 0, P(1) = 1, and P(n) = 2 P(n minus 1) + P(n minus 2). The ratio of consecutive terms approaches the silver ratio, 1 + the square root of 2.
Worked example
Building up: P(2) = 2(1) + 0 = 2, P(3) = 2(2) + 1 = 5, P(4) = 2(5) + 2 = 12, P(5) = 2(12) + 5 = 29. Enter 5 to confirm.
Frequently asked questions
What is the Pell sequence?
0, 1, 2, 5, 12, 29, 70 and so on, where each term is twice the previous plus the one before.
How do Pell numbers relate to the square root of two?
Ratios of Pell numbers and their companions give the best rational approximations to the square root of two.
What is the silver ratio?
1 plus the square root of two, about 2.414, the limit of consecutive Pell number ratios.
Who this calculator is for
This calculator is for students, programmers and anyone exploring number theory.
What this calculator assumes
- You enter a whole number within the stated range.
- The exact integer algorithm is used.
- Very large results are shown grouped for readability.
Formula and sources
Related calculators
- Prime Factorization Calculator: break a number into prime factors.
- LCM Calculator: lowest common multiple.
- GCF Calculator: greatest common factor.