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
- Choose the required indexes, integers or sequence entries. Preserve decimal-string encodings where the field table specifies strings.
- Enter n according to the field table, then run the tool.
- Read value. Preserve exact decimal strings and the stated indexing or coefficient order.
- Keep exact decimal strings for subsequent integer arithmetic; distinguish them from any explicitly approximate numeric result.
| Input field | Meaning | Value type and bounds | Requirement |
|---|---|---|---|
| n | Zero-indexed term (resource limit 100000) | integer; minimum 0; maximum 100000 | Required |
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 field | Meaning | Value type |
|---|---|---|
| value | Lucas number | string (integer/arbitrary) |
{
"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
-
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.