{
  "id": "lucas-numbers",
  "title": "Lucas Numbers",
  "lang": "en",
  "source_lang": "en",
  "summary": "Lucas numbers form an integer sequence closely related to Fibonacci numbers, with applications in combinatorics, number theory, and efficient computation.",
  "category": "mathematics",
  "subcategory": "algebra",
  "type": "concept",
  "aliases": [
    "Lucas number sequence"
  ],
  "generated_at": "2026-11-06",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/lucas-numbers/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/lucas-numbers/",
      "json": "https://aiwiki.page/zh/lucas-numbers.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "The Lucas numbers are the integers defined by \\(L_0=2\\), \\(L_1=1\\), and the recurrence relation\n\n\\[L_n=L_{n-1}+L_{n-2}\\qquad(n\\geq2).\\]\n\nThey obey the same recurrence as the Fibonacci numbers but have different initial values. Named after the French mathematician Édouard Lucas, they connect recurrence relations, the golden ratio, combinatorial counting, and divisibility properties. They are a particular instance of the broader family of Lucas sequences."
    },
    {
      "heading": "Definition and initial terms",
      "text": "Beginning with index zero, the sequence is\n\n\\[2,\\ 1,\\ 3,\\ 4,\\ 7,\\ 11,\\ 18,\\ 29,\\ 47,\\ 76,\\ 123,\\ 199,\\ 322,\\ldots\\]\n\nEach term after the first two is the sum of its predecessors. Some presentations begin with \\(L_1=1\\) and \\(L_2=3\\), omitting \\(L_0\\); including \\(L_0=2\\) makes many identities valid without exceptions at zero.\n\nThe recurrence also extends the sequence uniquely to negative indices. Solving backward gives\n\n\\[L_{-n}=(-1)^nL_n.\\]\n\nThus \\(L_{-1}=-1\\), \\(L_{-2}=3\\), and \\(L_{-3}=-4\\).\n\nLucas numbers should not be confused with the separate sequence used in the Lucas–Lehmer test for Mersenne primes, although that test is also connected with the wider theory of Lucas sequences."
    },
    {
      "heading": "Closed form and growth",
      "text": "Let\n\n\\[\\phi=\\frac{1+\\sqrt5}{2}, \\qquad \\psi=\\frac{1-\\sqrt5}{2}.\\]\n\nHere \\(\\phi\\) is the golden ratio, and \\(\\psi=-\\phi^{-1}\\). The Lucas numbers have the closed form\n\n\\[L_n=\\phi^n+\\psi^n.\\]\n\nTo derive it, a trial solution \\(x^n\\) to the recurrence leads to the quadratic equation\n\n\\[x^2-x-1=0.\\]\n\nIts roots are \\(\\phi\\) and \\(\\psi\\), so every solution has the form \\(A\\phi^n+B\\psi^n\\). The Lucas initial values give \\(A=B=1\\).\n\nBecause \\(|\\psi|<1\\),\n\n\\[L_n\\sim\\phi^n, \\qquad \\lim_{n\\to\\infty}\\frac{L_{n+1}}{L_n}=\\phi.\\]\n\nMore precisely,\n\n\\[|L_n-\\phi^n|=\\phi^{-n}.\\]\n\nConsequently, for every \\(n\\geq2\\), \\(L_n\\) is the nearest integer to \\(\\phi^n\\). The closed form also explains why the generally irrational quantities \\(\\phi^n\\) and \\(\\psi^n\\) have an integer sum: their irrational parts cancel."
    },
    {
      "heading": "Relations with Fibonacci numbers",
      "text": "Write the Fibonacci initial values as \\(F_0=0\\) and \\(F_1=1\\). Then\n\n\\[L_n=F_{n-1}+F_{n+1}\\qquad(n\\geq1),\\]\n\nor equivalently,\n\n\\[L_n=2F_{n+1}-F_n.\\]\n\nThese formulas show that Lucas numbers can be calculated directly from neighboring Fibonacci numbers.\n\nTwo important identities are\n\n\\[F_{2n}=F_nL_n\\]\n\nand\n\n\\[L_n^2-5F_n^2=4(-1)^n.\\]\n\nThe latter places Fibonacci–Lucas pairs on the Diophantine equations\n\n\\[x^2-5y^2=4 \\quad\\text{and}\\quad x^2-5y^2=-4,\\]\n\naccording to the parity of \\(n\\). It follows immediately from\n\n\\[L_n=\\phi^n+\\psi^n,\\qquad \\sqrt5F_n=\\phi^n-\\psi^n,\\qquad \\phi\\psi=-1.\\]\n\nUseful addition and doubling formulas include\n\n\\[L_{m+n}=L_mL_n-(-1)^nL_{m-n} \\qquad(m\\geq n\\geq0)\\]\n\nand\n\n\\[L_{2n}=L_n^2-2(-1)^n.\\]\n\nA Lucas analogue of Cassini’s identity is\n\n\\[L_{n-1}L_{n+1}-L_n^2=5(-1)^{n-1} \\qquad(n\\geq1).\\]\n\nThe finite sum of the sequence also has a simple form:\n\n\\[\\sum_{k=0}^{n}L_k=L_{n+2}-1.\\]\n\nThese identities can be established from the closed forms, the recurrence, or mathematical induction."
    },
    {
      "heading": "Generating function and matrix representation",
      "text": "The ordinary generating function is\n\n\\[G(x)=\\sum_{n=0}^{\\infty}L_nx^n =\\frac{2-x}{1-x-x^2}.\\]\n\nIndeed, multiplying the series by \\(1-x-x^2\\) cancels all coefficients of degree two and higher through the recurrence. The equality holds as a formal power series and analytically for \\(|x|<\\phi^{-1}\\).\n\nA matrix representation uses\n\n\\[Q= \\begin{pmatrix} 1&1\\\\ 1&0 \\end{pmatrix}.\\]\n\nFor \\(n\\geq1\\),\n\n\\[Q^n= \\begin{pmatrix} F_{n+1}&F_n\\\\ F_n&F_{n-1} \\end{pmatrix}.\\]\n\nTaking the trace gives\n\n\\[L_n=\\operatorname{tr}(Q^n),\\]\n\nwhich also holds at \\(n=0\\).\n\nThe eigenvalues of \\(Q\\) are \\(\\phi\\) and \\(\\psi\\), providing another explanation of the closed form. This representation connects Lucas identities with matrix multiplication and supports efficient computation by repeated squaring."
    },
    {
      "heading": "Combinatorial interpretations",
      "text": "Lucas numbers count several kinds of objects in combinatorics, particularly arrangements with circular rather than linear boundary conditions.\n\nFor \\(n\\geq3\\), \\(L_n\\) is the number of subsets of the vertices of a cycle with \\(n\\) labeled vertices that contain no adjacent pair. The empty subset is included.\n\nTo see this, fix one vertex and split the choices into two cases:\n\n- If the vertex is excluded, the remaining choices form a path on \\(n-1\\) vertices, giving \\(F_{n+1}\\) possibilities.\n- If it is included, both neighboring vertices must be excluded, leaving a path on \\(n-3\\) vertices and giving \\(F_{n-1}\\) possibilities.\n\nThe total is therefore\n\n\\[F_{n+1}+F_{n-1}=L_n.\\]\n\nEquivalently, \\(L_n\\) counts binary strings of length \\(n\\) with no consecutive ones when the first and last positions are also treated as adjacent. Positions remain labeled: strings related by rotation are counted separately.\n\nCounting these subsets by their size yields\n\n\\[L_n= \\sum_{k=0}^{\\lfloor n/2\\rfloor} \\frac{n}{n-k}\\binom{n-k}{k} \\qquad(n\\geq1),\\]\n\nwhere \\(\\binom{n-k}{k}\\) is a binomial coefficient. For cycle graphs with \\(n\\geq3\\), the summand counts the allowed subsets containing exactly \\(k\\) vertices."
    },
    {
      "heading": "Divisibility and prime terms",
      "text": "Lucas numbers exhibit many regularities in number theory. Their parity repeats with period three:\n\n\\[L_n\\text{ is even}\\quad\\Longleftrightarrow\\quad 3\\mid n.\\]\n\nThis follows by applying the recurrence modulo \\(2\\).\n\nMore generally, the sequence is purely periodic modulo every positive integer \\(m\\). In modular arithmetic, the update\n\n\\[(L_n,L_{n+1})\\longmapsto(L_{n+1},L_n+L_{n+1})\\]\n\nis invertible, and there are only finitely many residue pairs.\n\nFor \\(n\\geq1\\) and odd positive \\(k\\),\n\n\\[L_n\\mid L_{kn}.\\]\n\nUnlike Fibonacci numbers, Lucas numbers do not satisfy \\(L_a\\mid L_b\\) for every positive \\(a\\mid b\\): for example, \\(L_2=3\\) does not divide \\(L_4=7\\).\n\nA Lucas prime is a Lucas number that is a prime number. Early examples are\n\n\\[2,\\ 3,\\ 7,\\ 11,\\ 29,\\ 47,\\ 199,\\ 521.\\]\n\nIt is not known whether infinitely many Lucas primes exist.\n\nFor every prime \\(p\\),\n\n\\[L_p\\equiv1\\pmod p.\\]\n\nThis congruence resembles Fermat’s little theorem, but its converse is false. Composite integers can satisfy \\(L_n\\equiv1\\pmod n\\), so this congruence alone does not establish primality."
    },
    {
      "heading": "Generalized Lucas sequences",
      "text": "The standard Lucas numbers belong to a two-parameter family. For fixed integers \\(P,Q\\), define\n\n\\[U_0=0,\\quad U_1=1,\\quad U_n=PU_{n-1}-QU_{n-2},\\]\n\nand\n\n\\[V_0=2,\\quad V_1=P,\\quad V_n=PV_{n-1}-QV_{n-2}.\\]\n\nThe standard Fibonacci and Lucas numbers arise from\n\n\\[F_n=U_n(1,-1), \\qquad L_n=V_n(1,-1).\\]\n\nIf \\(\\alpha,\\beta\\) are distinct roots of \\(x^2-Px+Q=0\\), then\n\n\\[U_n=\\frac{\\alpha^n-\\beta^n}{\\alpha-\\beta}, \\qquad V_n=\\alpha^n+\\beta^n.\\]\n\nThis broader framework underlies many divisibility results and Lucas-based primality tests. The unqualified term “Lucas numbers” normally denotes the particular sequence \\(2,1,3,4,7,\\ldots\\), rather than every member of this family."
    },
    {
      "heading": "Computation",
      "text": "Sequential use of the recurrence computes \\(L_n\\) with \\(O(n)\\) integer additions and storage for only two consecutive terms. Matrix exponentiation or Fibonacci fast-doubling identities reduce the number of arithmetic operations to \\(O(\\log n)\\), in big-O notation.\n\nThese operation counts do not make exact computation logarithmic in bit complexity: \\(L_n\\) itself has a number of binary digits proportional to \\(n\\), and arithmetic on larger integers costs more. Direct evaluation of \\(\\phi^n+\\psi^n\\) using fixed-precision floating-point arithmetic can lose enough accuracy to produce an incorrect rounded integer. Exact recurrence or doubling methods avoid that problem."
    }
  ],
  "links": [
    "integer",
    "recurrence-relation",
    "fibonacci-sequence",
    "golden-ratio",
    "quadratic-equation",
    "diophantine-equation",
    "mathematical-induction",
    "generating-function",
    "power-series",
    "matrix",
    "matrix-trace",
    "eigenvalues-and-eigenvectors",
    "combinatorics",
    "binomial-coefficient",
    "number-theory",
    "modular-arithmetic",
    "prime-number",
    "fermats-little-theorem",
    "big-o-notation",
    "floating-point-arithmetic"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}