{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Example\n\nThe *Pell numbers* $P_n$ are the [[solution|06MJC8YDYR]] of\n$$P_{n+2} = 2 P_{n+1} + P_n \\qquad (n \\ge 0)$$\nwith $P_0 = 0$ and $P_1 = 1$.\nThe first terms are $0, 1, 2, 5, 12, 29, 70, 169, \\dots$.\nThe characteristic polynomial $X^2 - 2X - 1$ has roots $1 \\pm \\sqrt{2}$, which gives\n$$P_n = \\frac{(1 + \\sqrt{2})^n - (1 - \\sqrt{2})^n}{2\\sqrt{2}}.$$\nCheck: the formula solves the recurrence, since each root $q$ satisfies $q^2 = 2q + 1$; it gives $P_0 = 0$ and $P_1 = 2\\sqrt{2}/(2\\sqrt{2}) = 1$.\nThey form the [[Lucas sequence|DP39F5KQ2W]] $U_n(2, -1)$.\n\nLet $H_n$ be the solution of the same recurrence with $H_0 = H_1 = 1$, so $H_n = 1, 1, 3, 7, 17, 41, 99, \\dots$.\nThen $H_n^2 - 2 P_n^2 = (-1)^n$.\nFor example $3^2 - 2 \\cdot 2^2 = 1$ and $7^2 - 2 \\cdot 5^2 = -1$.\nSo the pairs $(H_n, P_n)$ give solutions of the [[Pell equations|0Z0NE3J6JX]] $x^2 - 2y^2 = \\pm 1$, and $H_n / P_n$ tends to $\\sqrt{2}$.\n\n## Explanations\n\n### L1 human\n\nPell numbers grow like the Fibonacci numbers, but each term is twice the previous one plus the one before.\nTheir ratio $P_{n+1}/P_n$ tends to $1 + \\sqrt{2}$, about $2.414$.\nThe fractions $1/1, 3/2, 7/5, 17/12, 41/29, \\dots$ built from them are better and better approximations of $\\sqrt{2}$.\nFor instance $17/12 \\approx 1.41667$ while $\\sqrt{2} \\approx 1.41421$.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "instance_of": [
      "06MJC8YDYR"
    ],
    "kind": "example",
    "msc": [
      "11B39",
      "39A06"
    ],
    "name": "Pell numbers",
    "same_as": {
      "wikidata": "Q1386491",
      "wikipedia": "Pell number"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Pell_number"
      }
    ],
    "tag": "JY4ZN779YG"
  },
  "kind": "example",
  "link": "https://tamnd.github.io/math2/node/JY4ZN779YG/",
  "links": [
    {
      "field": "instance_of",
      "target": "06MJC8YDYR"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/JY4ZN779YG.md",
  "msc": [
    "11B39",
    "39A06"
  ],
  "name": "Pell numbers",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/JY4/JY4ZN779YG.md",
  "status": null,
  "tag": "JY4ZN779YG",
  "uri": "m2://JY4ZN779YG",
  "url": "https://tamnd.github.io/math2/wiki/pell-numbers/",
  "writing": {
    "tag": "JY4ZN779YG",
    "kind": "example",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
