Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #18 Nov 12 2024 22:17:16
%S 1,2,3,2,4,7,0,2,2,9,0,0,2,4,13,0,0,0,2,2,15,2,2,2,2,4,6,21,2,0,2,0,2,
%T 2,4,25,2,0,0,2,2,0,2,6,31,0,2,2,2,0,2,2,4,2,33,0,0,2,0,2,2,0,2,2,4,
%U 37,0,0,0,2,2,0,2,2,0,2,6,43,2,2,2,2,0,2
%N Triangle of iterated absolute differences of lucky numbers read by antidiagonals upwards.
%C This sequence is related to the lucky numbers (cf. A000959) in the same way as A036262 is related to the prime numbers;
%H Reinhard Zumkeller, <a href="/A254967/b254967.txt">Rows n = 0..125 of triangle, flattened</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/LuckyNumber.html">Lucky number.</a>
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Lucky_number">Lucky number</a>
%F T(n,0) = A054978(n).
%F T(2*n,n) = A254969(n).
%F T(n,n-1) = A031883(n) for n > 0.
%F T(n,n) = A000959(n+1).
%F T(n,k) = abs(T(n,k+1) - T(n-1,k)) for 0 <= k < n.
%e . 0: 1
%e . 1: 2 3
%e . 2: 2 4 7
%e . 3: 0 2 2 9
%e . 4: 0 0 2 4 13
%e . 5: 0 0 0 2 2 15
%e . 6: 2 2 2 2 4 6 21
%e . 7: 2 0 2 0 2 2 4 25
%e . 8: 2 0 0 2 2 0 2 6 31
%e . 9: 0 2 2 2 0 2 2 4 2 33
%e . 10: 0 0 2 0 2 2 0 2 2 4 37
%e . 11: 0 0 0 2 2 0 2 2 0 2 6 43
%e . 12: 2 2 2 2 0 2 2 0 2 2 0 6 49
%e . 13: 0 2 0 2 0 0 2 0 0 2 4 4 2 51 .
%t nmax = 13; (* max index for triangle rows *)
%t imax = 25; (* max index for initial lucky array L *)
%t L = Table[2i + 1, {i, 0, imax}];
%t For[n = 2, n < Length[L], r = L[[n++]]; L = ReplacePart[L, Table[r*i -> Nothing, {i, 1, Length[L]/r}]]];
%t T[n_, n_] := If[n+1 <= Length[L], L[[n+1]], Print["imax should be increased"]; 0];
%t T[n_, k_] := T[n, k] = Abs[T[n, k+1] - T[n-1, k]];
%t Table[T[n, k], {n, 0, nmax}, {k, 0, n}] // Flatten (* _Jean-François Alcover_, Sep 22 2021 *)
%o (Haskell)
%o a254967 n k = a254967_tabl !! n !! k
%o a254967_row n = a254967_tabl !! n
%o a254967_tabl = diags [] $
%o iterate (\lds -> map abs $ zipWith (-) (tail lds) lds) a000959_list
%o where diags uss (vs:vss) = (map head wss) : diags (map tail wss) vss
%o where wss = vs : uss
%Y Cf. A054978 (left edge), A254969 (central terms), A000959 (right edge), A031883, A036262.
%K nonn,tabl
%O 0,2
%A _Reinhard Zumkeller_, Feb 11 2015