Pell Number Calculator

Input

Pell number P(n)2,378
Previous Pell number P(n-1)985
Next Pell number P(n+1)5,741
Companion value x = P(n) + P(n-1)3,363
Pell equation check x^2 - 2y^21
How this was calculated
  1. Pell numbers follow the recurrence P(n) = 2P(n-1) + P(n-2), starting from P(0) = 0 and P(1) = 1 - the recurrence behind the silver ratio convergents.
  2. Building the sequence up to n = 10 gives P(10) = 2,378, with P(9) = 985 and P(11) = 5,741.
  3. Consecutive terms approach the silver ratio 1 + sqrt(2): P(10) / P(9) = 2.4142.
  4. Pairing P(10) with the companion value x = P(10) + P(9) = 3,363 solves the Pell equation: 3,363^2 - 2 x 2,378^2 = 1.

This Pell number calculator generates the Pell sequence using the recurrence P(n) = 2P(n-1) + P(n-2), starting from P(0) = 0 and P(1) = 1. Enter a term index and the tool returns that Pell number along with the surrounding terms, so you can see where it sits in the sequence. For example, P(10) = 2,378, between P(9) = 985 and P(11) = 5,741. Larger and smaller indices work the same way: P(6) = 70 and P(20) = 15,994,428. The calculator also relates each term to the Pell equation x^2 - 2y^2 = +/-1 by pairing P(n) with the companion value P(n) + P(n-1). For n = 10, that pairing gives 3,363^2 - 2 x 2,378^2 = 1.

The method behind the calculator is the standard one because it applies the defining recurrence directly, term by term, rather than approximating. That same recurrence is what produces the convergents to the silver ratio, 1 + sqrt(2), which consecutive Pell terms approach: P(10) / P(9) = 2.4142. Working forward from the two seed values P(0) = 0 and P(1) = 1 leaves no room for rounding drift in the integer terms, and the companion pairing P(n) + P(n-1) is the accepted way to read off solutions to x^2 - 2y^2 = +/-1. This page shows the formula, step-by-step workings, worked examples and sources so you can check every result yourself.

Worked examples

P(10), a classic table value

(10)

Pell number P(n)2,378
Previous Pell number P(n-1)985
Next Pell number P(n+1)5,741
Companion value x = P(n) + P(n-1)3,363
Pell equation check x^2 - 2y^21

P(20)

(20)

Pell number P(n)15,994,428
Previous Pell number P(n-1)6,625,109
Next Pell number P(n+1)38,613,965
Companion value x = P(n) + P(n-1)22,619,537
Pell equation check x^2 - 2y^21

P(6)

(6)

Pell number P(n)70
Previous Pell number P(n-1)29
Next Pell number P(n+1)169
Companion value x = P(n) + P(n-1)99
Pell equation check x^2 - 2y^21

What the Pell numbers count

The Pell numbers are defined by a simple rule: start with P(0) = 0 and P(1) = 1, then build each new term with P(n) = 2P(n-1) + P(n-2). Every term is twice the one before it, plus the term before that. The first several values are 0, 1, 2, 5, 12, 29, 70, 169, 408, 985, 2,378. Notice that P(6) = 70 and P(10) = 2,378 — the sequence climbs quickly because each step roughly multiplies the previous term by the same factor. A pell number calculator simply applies this recurrence repeatedly, so you can jump to a large index without working through every term by hand.

What makes the sequence more than a list of numbers is what it counts and approximates. The Pell numbers are the recurrence behind the convergents to the silver ratio, and their ratios squeeze in on 1 + sqrt(2). Consecutive terms approach that value: P(10) / P(9) = 2.4142. So the sequence is a machine for producing better and better rational approximations of sqrt(2) and the silver ratio, the same way Fibonacci ratios approach the golden ratio.

The sequence also solves a classic number theory puzzle. Pairing P(n) with the companion value P(n) + P(n-1) gives integer solutions to the Pell equation x^2 - 2y^2 = +/-1. For n = 10, the companion is 2,378 + 985 = 3,363, and indeed 3,363^2 - 2 x 2,378^2 = 1. Each index hands you a fresh pair of whole numbers whose squares differ by exactly one after the factor of 2 — a fact that surprises many people the first time they see it.

The scale of the sequence is worth appreciating. P(10) = 2,378 sits between P(9) = 985 and P(11) = 5,741, and by P(20) the value has reached 15,994,428. That growth is why a pell number calculator is useful: the recurrence is trivial to state but tedious to repeat twenty or thirty times without an arithmetic slip. Feed in an index, and the tool returns the term, letting you focus on the pattern rather than the multiplication.

In short, the Pell numbers are a compact package: a two-term recurrence, a stream of rational approximations to sqrt(2), and a supply of solutions to x^2 - 2y^2 = +/-1. Each new term does all three jobs at once.

P(10) / P(9) = 2.4142, closing in on the silver ratio 1 + sqrt(2).

Building the sequence

Every Pell number comes from the same short rule: each term is twice the one before it, plus the term before that. Written out, P(n) = 2P(n-1) + P(n-2), and the sequence starts from P(0) = 0 and P(1) = 1. That is the same recurrence behind the convergents to the silver ratio, which is why a pell number calculator can move from one term to the next with nothing more than doubling and adding.

The table below shows the recurrence at work around P(10). P(9) is 985 and P(10) is 2,378, and the step between them follows the rule: twice 985 plus the term before it gives 2,378. The next step applies the same rule again to reach P(11) = 5,741. Nothing in the table is guessed; each entry is the previous two entries combined in the fixed pattern.

The growth is steady rather than explosive at first, but it adds up. Further out in the sequence, P(20) = 15,994,428, which shows how quickly the doubling-and-adding rule compounds. For a smaller reference point, P(6) = 70. Seeing both ends of the sequence helps you check that a pell number calculator is following the same recurrence you would use by hand.

There is a reason these numbers matter beyond the sequence itself. Pairing P(n) with the companion value P(n) + P(n-1) solves the Pell equation x^2 - 2y^2 = +/-1. For n = 10, the companion value is 3,363, and 3,363^2 - 2 x 2,378^2 = 1. Consecutive terms also approach the silver ratio, 1 + sqrt(2): P(10) / P(9) = 2.4142. Those two facts are why the recurrence is worth building step by step.

TermValueHow it is built
P(6)70From the recurrence P(n) = 2P(n-1) + P(n-2)
P(9)985From the recurrence P(n) = 2P(n-1) + P(n-2)
P(10)2,3782 x 985 plus the term before it
P(11)5,7412 x 2,378 plus 985
P(20)15,994,428Reached by continuing the same recurrence
The recurrence P(n) = 2P(n-1) + P(n-2) is all you need to extend the sequence past P(20) = 15,994,428.

The companion value and the Pell equation

The Pell numbers are usually introduced as a single sequence, but each term carries a companion value that turns the sequence into a solution machine for a famous Diophantine equation. The companion of P(n) is simply P(n) + P(n-1) — the next Pell number added to the one before it. So if you set y = P(n) and x = P(n) + P(n-1), the pair (x, y) solves x^2 - 2y^2 = ±1. That is the Pell equation, and it is the reason a pell number calculator is useful for more than listing terms: it lets you check these solution pairs directly.

The mechanism is easiest to see with a concrete n. Take n = 10. The recurrence P(n) = 2P(n-1) + P(n-2), starting from P(0) = 0 and P(1) = 1, gives P(9) = 985 and P(10) = 2,378, with P(11) = 5,741 sitting just above. The companion value for n = 10 is therefore 2,378 + 985 = 3,363. Plug both numbers into the equation: 3,363^2 - 2 × 2,378^2 = 1. The left side is 11,309,769 minus 2 × 5,654,884, which is 11,309,769 minus 11,309,768 — exactly 1. The pair (3,363, 2,378) is a genuine solution, and the arithmetic checks out with no rounding anywhere.

The sign alternates as you move along the sequence, which is why the equation is written with ±1 rather than a plain 1. Each successive n produces the next solution pair, alternating between +1 and -1, so the same construction keeps generating integer solutions to x^2 - 2y^2 = ±1. This is the same structure that appears in the convergents to the silver ratio, 1 + sqrt(2), which the Pell recurrence underlies. Consecutive Pell terms close in on that ratio: P(10) / P(9) = 2.4142, matching 1 + sqrt(2) to four decimal places.

The companion value also makes the growth of the sequence tangible. P(6) = 70, P(10) = 2,378, and P(20) = 15,994,428 — each step multiplies the size of the terms dramatically, and the companion x = P(n) + P(n-1) grows alongside y = P(n). Because both x and y come from the same recurrence, you never need to search for solutions to the Pell equation; you just read them off consecutive Pell numbers.

  • Companion value: x = P(n) + P(n-1), paired with y = P(n)
  • Check for n = 10: x = 2,378 + 985 = 3,363 and y = 2,378
  • Verification: 3,363^2 - 2 × 2,378^2 = 1
  • The sign alternates, giving solutions to x^2 - 2y^2 = ±1
  • P(10) / P(9) = 2.4142, approaching the silver ratio 1 + sqrt(2)
For n = 10 the companion pair is (3,363, 2,378), and 3,363^2 - 2 × 2,378^2 = 1 exactly.

The silver ratio limit

If you divide one Pell number by the one before it, the answer does not land in the same place every time, but it keeps closing in on a single value. A pell number calculator makes this easy to watch: run the recurrence forward and compute each ratio of consecutive terms. By the time you reach the tenth term, the pattern is already visible. P(10) is 2,378 and P(9) is 985, so P(10) / P(9) = 2.4142. That number is the silver ratio, written exactly as 1 + sqrt(2), and it is the destination the ratios are heading toward.

The approach is steady because the Pell numbers grow by the rule P(n) = 2P(n-1) + P(n-2), starting from P(0) = 0 and P(1) = 1. Each term is roughly 2.4142 times the term before it once the sequence is large enough. You can see the scale of that growth in the values themselves: P(6) = 70, P(10) = 2,378, and P(20) = 15,994,428. The step from P(9) = 985 to P(10) = 2,378 to P(11) = 5,741 shows the same multiplier at work, with each jump a little more than double the previous term.

The silver ratio also explains why the Pell numbers are tied to the continued fraction of sqrt(2). The convergents of that continued fraction are built from exactly this kind of recurrence, and the Pell sequence is the recurrence behind the convergents to the silver ratio. The ratios of consecutive Pell numbers are the practical face of that structure: they are the fractions that approximate 1 + sqrt(2) more and more closely as n grows. Checking P(10) / P(9) = 2.4142 is a quick way to see the limit in action without working through the full continued fraction by hand.

There is a second payoff that comes from pairing each Pell number with its companion value, P(n) + P(n-1). Those pairs solve the Pell equation x^2 - 2y^2 = +/-1. For n = 10, the companion is 2,378 + 985 = 3,363, and the equation checks out exactly: 3,363^2 - 2 x 2,378^2 = 1. So the same numbers that push the ratio toward 2.4142 also produce integer solutions to a classic Diophantine equation, which is why the sequence earns its name.

P(10) / P(9) = 2,378 / 985 = 2.4142, the silver ratio 1 + sqrt(2). The ratios of consecutive Pell numbers close in on this value as n grows.

FAQs

What is a Pell number?

A Pell number is a term of the sequence P(n) = 2P(n-1) + P(n-2), which starts 0, 1, 2, 5, 12, 29, 70. Each term is twice the previous term plus the term before that. These numbers serve as the denominators and numerators behind approximations to the square root of 2.

What is P(10)?

P(10) is 2,378. It follows P(9) = 985, and applying the rule P(n) = 2P(n-1) + P(n-2) to that term gives 2 × 985 + 408 = 2,378. The calculator returns this value directly for n = 10 without requiring you to work through the earlier terms one by one.

How do Pell numbers solve the Pell equation?

Set y = P(n) and x = P(n) + P(n-1). Then x^2 - 2y^2 comes out as either +1 or -1, so each Pell number supplies a solution pair. For n = 10 the pair is 3,363 and 2,378. The calculator reports both the y-value and the matching x-value for the index you enter.

What ratio do consecutive Pell numbers approach?

The ratio of consecutive Pell numbers approaches the silver ratio, 1 + sqrt(2), which is about 2.4142. The convergence is fast: P(10) / P(9) is already 2.4142. Dividing any Pell number by the one before it gives an estimate of the silver ratio, and the estimate improves as the index grows.

What is P(20)?

P(20) is 15,994,428. That value comes from applying the recurrence P(n) = 2P(n-1) + P(n-2) repeatedly from the starting terms 0 and 1. Because the terms grow quickly, the calculator handles the repeated doubling for you and returns P(20) and other large indices without manual steps.

Are Pell numbers the same as the solutions of the Pell equation?

No. The Pell numbers supply the y-values in the equation x^2 - 2y^2 = ±1, but they are not the whole solution pair. The matching x-values are the companion values P(n) + P(n-1); for n = 6, that companion value is 99. The calculator shows both parts of the pair.

Sources

Related calculators

Fibonacci Calculator
The nth Fibonacci number, computed exactly with arbitrary-precision arithmetic — plus the next term, the sum of the first n terms, and how close the ratio has come to the golden ratio.
Lucas Number Calculator
The nth Lucas number by its recurrence, with the companion Fibonacci number, the identity check L(n) = F(n-1) + F(n+1) and the ratio that converges to the square root of five.
Pell Equation Calculator
Find the minimal solution of x^2 - D y^2 = 1 with exact integer arithmetic: the continued fraction period of sqrt(D), the convergent that gives the fundamental solution, and a substitution check.