OFFSET
0,2
COMMENTS
LINKS
Reinhard Zumkeller, Rows n = 0..125 of triangle, flattened
Eric Weisstein's World of Mathematics, Lucky number.
Wikipedia, Lucky number
FORMULA
EXAMPLE
. 0: 1
. 1: 2 3
. 2: 2 4 7
. 3: 0 2 2 9
. 4: 0 0 2 4 13
. 5: 0 0 0 2 2 15
. 6: 2 2 2 2 4 6 21
. 7: 2 0 2 0 2 2 4 25
. 8: 2 0 0 2 2 0 2 6 31
. 9: 0 2 2 2 0 2 2 4 2 33
. 10: 0 0 2 0 2 2 0 2 2 4 37
. 11: 0 0 0 2 2 0 2 2 0 2 6 43
. 12: 2 2 2 2 0 2 2 0 2 2 0 6 49
. 13: 0 2 0 2 0 0 2 0 0 2 4 4 2 51 .
MATHEMATICA
nmax = 13; (* max index for triangle rows *)
imax = 25; (* max index for initial lucky array L *)
L = Table[2i + 1, {i, 0, imax}];
For[n = 2, n < Length[L], r = L[[n++]]; L = ReplacePart[L, Table[r*i -> Nothing, {i, 1, Length[L]/r}]]];
T[n_, n_] := If[n+1 <= Length[L], L[[n+1]], Print["imax should be increased"]; 0];
T[n_, k_] := T[n, k] = Abs[T[n, k+1] - T[n-1, k]];
Table[T[n, k], {n, 0, nmax}, {k, 0, n}] // Flatten (* Jean-François Alcover, Sep 22 2021 *)
PROG
(Haskell)
a254967 n k = a254967_tabl !! n !! k
a254967_row n = a254967_tabl !! n
a254967_tabl = diags [] $
iterate (\lds -> map abs $ zipWith (-) (tail lds) lds) a000959_list
where diags uss (vs:vss) = (map head wss) : diags (map tail wss) vss
where wss = vs : uss
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Reinhard Zumkeller, Feb 11 2015
STATUS
approved