cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A354265 Array read by ascending antidiagonals for n >= 0 and k >= 0. Generalized Lucas numbers, L(n, k) = (psi^(k - 1)*(phi + n) - phi^(k - 1)*(psi + n)), where phi = (1 + sqrt(5))/2 and psi = (1 - sqrt(5))/2.

Original entry on oeis.org

2, 3, 1, 4, 4, 3, 5, 7, 7, 4, 6, 10, 11, 11, 7, 7, 13, 15, 18, 18, 11, 8, 16, 19, 25, 29, 29, 18, 9, 19, 23, 32, 40, 47, 47, 29, 10, 22, 27, 39, 51, 65, 76, 76, 47, 11, 25, 31, 46, 62, 83, 105, 123, 123, 76, 12, 28, 35, 53, 73, 101, 134, 170, 199, 199, 123
Offset: 0

Views

Author

Peter Luschny, May 29 2022

Keywords

Comments

The definition declares the Lucas numbers for all integers n and k. It gives the classical Lucas numbers as L(0, n) = Lucas(n), where Lucas(n) = A000032(n) is extended in the usual way for negative n.

Examples

			Array starts:
[0]  2,  1,  3,  4,   7,  11,  18,  29,  47,   76, ... A000032
[1]  3,  4,  7, 11,  18,  29,  47,  76, 123,  199, ... A000032 (shifted)
[2]  4,  7, 11, 18,  29,  47,  76, 123, 199,  322, ... A000032 (shifted)
[3]  5, 10, 15, 25,  40,  65, 105, 170, 275,  445, ... A022088
[4]  6, 13, 19, 32,  51,  83, 134, 217, 351,  568, ... A022388
[5]  7, 16, 23, 39,  62, 101, 163, 264, 427,  691, ... A190995
[6]  8, 19, 27, 46,  73, 119, 192, 311, 503,  814, ... A206420
[7]  9, 22, 31, 53,  84, 137, 221, 358, 579,  937, ... A206609
[8] 10, 25, 35, 60,  95, 155, 250, 405, 655, 1060, ...
[9] 11, 28, 39, 67, 106, 173, 279, 452, 731, 1183, ...
		

Crossrefs

Programs

  • Julia
    const FibMem = Dict{Int,Tuple{BigInt,BigInt}}()
    function FibRec(n::Int)
        get!(FibMem, n) do
            n == 0 && return (BigInt(0), BigInt(1))
            a, b = FibRec(div(n, 2))
            c = a * (b * 2 - a)
            d = a * a + b * b
            iseven(n) ? (c, d) : (d, c + d)
        end
    end
    function Lucas(n, k)
        k ==  0 && return BigInt(n + 2)
        k == -1 && return BigInt(2 * n - 1)
        k <   0 && return (-1)^k * Lucas(1 - n, -k - 2)
        a, b = FibRec(k)
        c, d = FibRec(k - 1)
        n * (2 * a + b) + 2 * c + d
    end
    for n in -6:6
        println([Lucas(n, k) for k in -6:6])
    end
  • Maple
    phi := (1 + sqrt(5))/2: psi := (1 - sqrt(5))/2:
    L := (n, k) -> phi^(k+1)*(n - psi) + psi^(k+1)*(n - phi):
    seq(seq(simplify(L(n-k, k)), k = 0..n), n = 0..10);
  • Mathematica
    L[n_, k_] := With[{c = Pi/2 + I*ArcCsch[2]},
                 I^k Sec[c] (n Cos[c (k + 1)] - I Cos[c k]) ];
    Table[Simplify[L[n, k]], {n, 0, 6}, {k, 0, 6}] // TableForm
    (* Alternative: *)
    L[n_, k_] := n*LucasL[k + 1] + LucasL[k];
    Table[Simplify[L[n, k]], {n, 0, 6}, {k, 0, 6}] // TableForm

Formula

Functional equation extends Cassini's theorem:
L(n, k) = (-1)^k*L(1 - n, -k - 2).
L(n, k) = n*Lucas(k + 1) + Lucas(k).
L(n, k) = L(n, k-1) + L(n, k-2).
L(n, k) = i^k*sec(c)*(n*cos(c*(k + 1)) - i*cos(c*k)), where c = Pi/2 + i*arccsch(2), for all n, k in Z.
Using the generalized Fibonacci numbers F(n, k) = A352744(n, k),
L(n, k) = F(n, k+1) + F(n, k) + F(n, k-1) + F(n, k-2).