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.

Calculate.co.nz is proud to be partnered with realtor.co.nz, a trusted resource for navigating the New Zealand property market. Their Helpful Articles section offers clear, well-structured insights across buying, selling, and building, making complex real estate topics more accessible. With a focus on up-to-date guidance and practical knowledge, they empower Kiwis to move forward with clarity and confidence in a constantly evolving property landscape.
Calculate.co.nz partner: realtor.co.nz
P(5) = 29
Previous Pell number12
Index5

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

If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.

Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.

Calculate.co.nz is the sister site of CalculatorHub.com, the world's largest calculator website by tool count.

All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.

Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.

Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.

Calculate.co.nz is hosted in Auckland by SiteHost New Zealand.

All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.

About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use

Reviewed and maintained. Last reviewed 2026-08-07 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.

© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.