nth Lucas Number

Return L(n) exactly as a decimal string with L(0)=2 and L(1)=1; the index is capped at 100,000 for bounded computation.

Description

Lucas numbers share the Fibonacci recurrence but begin with two and one.

Lucas numbers share the Fibonacci recurrence but begin with two and one. These initial values determine a different sequence with the same growth pattern.1

The tool returns value. The indexing and output conventions below determine how to read these values.

When to use nth Lucas Number

Use this for the following task: Return L(n) exactly as a decimal string with L(0)=2 and L(1)=1; the index is capped at 100,000 for bounded computation. Use the input and output conventions below to reproduce the intended mathematical quantity.

How to use nth Lucas Number and understand its results

  1. Choose the required indexes, integers or sequence entries. Preserve decimal-string encodings where the field table specifies strings.
  2. Enter n according to the field table, then run the tool.
  3. Read value. Preserve exact decimal strings and the stated indexing or coefficient order.
  4. Keep exact decimal strings for subsequent integer arithmetic; distinguish them from any explicitly approximate numeric result.
Input fieldMeaningValue type and boundsRequirement
nZero-indexed term (resource limit 100000)integer; minimum 0; maximum 100000Required

Advance a two-value BigInt state for n steps and return the zero-based term as a decimal string.

L(0)=2; L(1)=1; L(n)=L(n−1)+L(n−2)

The symbols and boundary conditions refer to the supplied fields and the implementation described above.

Output fieldMeaningValue type
valueLucas numberstring (integer/arbitrary)
json
{
  "input": {
    "n": 20
  },
  "output": {
    "value": "15127"
  }
}

Limitations and assumptions

The index is at most 100000. The result is exact integer text, with no configurable initial values or full sequence prefix.

Use the declared integer bounds and string formats. Large exact outputs remain decimal strings; numerical approximations use ordinary floating-point arithmetic. A rejected input is different from a valid zero count or false membership flag.

Alternative or Complementary methods

Choose nth Fibonacci Number when you need its operation: Return F(n) exactly as a decimal string with F(0)=0 and F(1)=1; the index is capped at 100,000 for bounded computation. Choose nth Pell Number for the complementary operation: Return P(n) exactly with P(0)=0, P(1)=1, and P(n)=2P(n−1)+P(n−2); the index is capped at 10,000.

Background reference: OEIS A000032.

References

  1. OEIS A000032 — OEIS Foundation

Similar or alternative tools

  • nth Fibonacci Number

    Return F(n) exactly as a decimal string with F(0)=0 and F(1)=1; the index is capped at 100,000 for bounded computation.

  • nth Pell Number

    Return P(n) exactly with P(0)=0, P(1)=1, and P(n)=2P(n−1)+P(n−2); the index is capped at 10,000.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies