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.

A254967 Triangle of iterated absolute differences of lucky numbers read by antidiagonals upwards.

This page as a plain text file.
%I A254967 #19 Feb 16 2025 08:33:24
%S A254967 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 A254967 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 A254967 37,0,0,0,2,2,0,2,2,0,2,6,43,2,2,2,2,0,2
%N A254967 Triangle of iterated absolute differences of lucky numbers read by antidiagonals upwards.
%C A254967 This sequence is related to the lucky numbers (cf. A000959) in the same way as A036262 is related to the prime numbers;
%H A254967 Reinhard Zumkeller, <a href="/A254967/b254967.txt">Rows n = 0..125 of triangle, flattened</a>
%H A254967 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/LuckyNumber.html">Lucky number.</a>
%H A254967 Wikipedia, <a href="http://en.wikipedia.org/wiki/Lucky_number">Lucky number</a>
%F A254967 T(n,0) = A054978(n).
%F A254967 T(2*n,n) = A254969(n).
%F A254967 T(n,n-1) = A031883(n) for n > 0.
%F A254967 T(n,n) = A000959(n+1).
%F A254967 T(n,k) = abs(T(n,k+1) - T(n-1,k)) for 0 <= k < n.
%e A254967 .   0:                      1
%e A254967 .   1:                     2 3
%e A254967 .   2:                    2 4 7
%e A254967 .   3:                   0 2 2 9
%e A254967 .   4:                  0 0 2 4 13
%e A254967 .   5:                 0 0 0 2 2 15
%e A254967 .   6:                2 2 2 2 4 6 21
%e A254967 .   7:               2 0 2 0 2 2 4 25
%e A254967 .   8:              2 0 0 2 2 0 2 6 31
%e A254967 .   9:             0 2 2 2 0 2 2 4 2 33
%e A254967 .  10:            0 0 2 0 2 2 0 2 2 4 37
%e A254967 .  11:           0 0 0 2 2 0 2 2 0 2 6 43
%e A254967 .  12:          2 2 2 2 0 2 2 0 2 2 0 6 49
%e A254967 .  13:         0 2 0 2 0 0 2 0 0 2 4 4 2 51 .
%t A254967 nmax = 13; (* max index for triangle rows *)
%t A254967 imax = 25; (* max index for initial lucky array L *)
%t A254967 L = Table[2i + 1, {i, 0, imax}];
%t A254967 For[n = 2, n < Length[L], r = L[[n++]]; L = ReplacePart[L, Table[r*i -> Nothing, {i, 1, Length[L]/r}]]];
%t A254967 T[n_, n_] := If[n+1 <= Length[L], L[[n+1]], Print["imax should be increased"]; 0];
%t A254967 T[n_, k_] := T[n, k] = Abs[T[n, k+1] - T[n-1, k]];
%t A254967 Table[T[n, k], {n, 0, nmax}, {k, 0, n}] // Flatten (* _Jean-François Alcover_, Sep 22 2021 *)
%o A254967 (Haskell)
%o A254967 a254967 n k = a254967_tabl !! n !! k
%o A254967 a254967_row n = a254967_tabl !! n
%o A254967 a254967_tabl = diags [] $
%o A254967    iterate (\lds -> map abs $ zipWith (-) (tail lds) lds) a000959_list
%o A254967    where diags uss (vs:vss) = (map head wss) : diags (map tail wss) vss
%o A254967                               where wss = vs : uss
%Y A254967 Cf. A054978 (left edge), A254969 (central terms), A000959 (right edge), A031883, A036262.
%K A254967 nonn,tabl
%O A254967 0,2
%A A254967 _Reinhard Zumkeller_, Feb 11 2015