%I #11 Nov 22 2022 09:40:39
%S 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,
%T 18,9,19,23,32,40,47,47,29,10,22,27,39,51,65,76,76,47,11,25,31,46,62,
%U 83,105,123,123,76,12,28,35,53,73,101,134,170,199,199,123
%N 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.
%C 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.
%H Peter Luschny, <a href="https://www.luschny.de/math/seq/oeis/FibonacciFunction.html">The Fibonacci Function</a>.
%F Functional equation extends Cassini's theorem:
%F L(n, k) = (-1)^k*L(1 - n, -k - 2).
%F L(n, k) = n*Lucas(k + 1) + Lucas(k).
%F L(n, k) = L(n, k-1) + L(n, k-2).
%F 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.
%F Using the generalized Fibonacci numbers F(n, k) = A352744(n, k),
%F L(n, k) = F(n, k+1) + F(n, k) + F(n, k-1) + F(n, k-2).
%e Array starts:
%e [0] 2, 1, 3, 4, 7, 11, 18, 29, 47, 76, ... A000032
%e [1] 3, 4, 7, 11, 18, 29, 47, 76, 123, 199, ... A000032 (shifted)
%e [2] 4, 7, 11, 18, 29, 47, 76, 123, 199, 322, ... A000032 (shifted)
%e [3] 5, 10, 15, 25, 40, 65, 105, 170, 275, 445, ... A022088
%e [4] 6, 13, 19, 32, 51, 83, 134, 217, 351, 568, ... A022388
%e [5] 7, 16, 23, 39, 62, 101, 163, 264, 427, 691, ... A190995
%e [6] 8, 19, 27, 46, 73, 119, 192, 311, 503, 814, ... A206420
%e [7] 9, 22, 31, 53, 84, 137, 221, 358, 579, 937, ... A206609
%e [8] 10, 25, 35, 60, 95, 155, 250, 405, 655, 1060, ...
%e [9] 11, 28, 39, 67, 106, 173, 279, 452, 731, 1183, ...
%p phi := (1 + sqrt(5))/2: psi := (1 - sqrt(5))/2:
%p L := (n, k) -> phi^(k+1)*(n - psi) + psi^(k+1)*(n - phi):
%p seq(seq(simplify(L(n-k, k)), k = 0..n), n = 0..10);
%t L[n_, k_] := With[{c = Pi/2 + I*ArcCsch[2]},
%t I^k Sec[c] (n Cos[c (k + 1)] - I Cos[c k]) ];
%t Table[Simplify[L[n, k]], {n, 0, 6}, {k, 0, 6}] // TableForm
%t (* Alternative: *)
%t L[n_, k_] := n*LucasL[k + 1] + LucasL[k];
%t Table[Simplify[L[n, k]], {n, 0, 6}, {k, 0, 6}] // TableForm
%o (Julia)
%o const FibMem = Dict{Int,Tuple{BigInt,BigInt}}()
%o function FibRec(n::Int)
%o get!(FibMem, n) do
%o n == 0 && return (BigInt(0), BigInt(1))
%o a, b = FibRec(div(n, 2))
%o c = a * (b * 2 - a)
%o d = a * a + b * b
%o iseven(n) ? (c, d) : (d, c + d)
%o end
%o end
%o function Lucas(n, k)
%o k == 0 && return BigInt(n + 2)
%o k == -1 && return BigInt(2 * n - 1)
%o k < 0 && return (-1)^k * Lucas(1 - n, -k - 2)
%o a, b = FibRec(k)
%o c, d = FibRec(k - 1)
%o n * (2 * a + b) + 2 * c + d
%o end
%o for n in -6:6
%o println([Lucas(n, k) for k in -6:6])
%o end
%Y Cf. A000032, A000204, A022088, A022388, A190995, A206420, A206609.
%Y Cf. A352744.
%K nonn,tabl
%O 0,1
%A _Peter Luschny_, May 29 2022