Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #30 Jul 14 2023 11:54:15
%S 0,0,1,0,3,1,2,0,7,5,2,6,1,3,4,0,15,13,10,6,1,11,4,12,3,9,14,2,5,7,8,
%T 0,31,29,26,22,17,11,4,28,19,9,30,18,5,23,8,24,7,21,2,14,25,3,12,20,
%U 27,1,6,10,13,15,16,0,63,61,58,54,49,43,36,28,19,9
%N T(n,k) = -k*(k+1)/2 mod 2^n; triangle T(n,k), n>=0, 0<=k<=2^n-1, read by rows.
%C Row n is a permutation of {0, 1, ..., A000225(n)}.
%H Alois P. Heinz, <a href="/A331105/b331105.txt">Rows n = 0..15, flattened</a>
%e Triangle T(n,k) begins:
%e 0;
%e 0, 1;
%e 0, 3, 1, 2;
%e 0, 7, 5, 2, 6, 1, 3, 4;
%e 0, 15, 13, 10, 6, 1, 11, 4, 12, 3, 9, 14, 2, 5, 7, 8;
%e ...
%p T:= n-> (p-> seq(modp(-k*(k+1)/2, p), k=0..p-1))(2^n):
%p seq(T(n), n=0..6);
%p # second Maple program:
%p T:= proc(n, k) option remember;
%p `if`(k=0, 0, T(n, k-1)-k mod 2^n)
%p end:
%p seq(seq(T(n, k), k=0..2^n-1), n=0..6);
%t T[n_, k_] := T[n, k] = If[k == 0, 0, Mod[T[n, k - 1] - k, 2^n]];
%t Table[Table[T[n, k], {k, 0, 2^n - 1}], {n, 0, 6}] // Flatten (* _Jean-François Alcover_, Mar 28 2022, after _Alois P. Heinz_ *)
%Y Columns k=0-2 give: A000004, A000225, A036563 (for n>1).
%Y Row sums give A006516.
%Y Row lengths give A000079.
%Y T(n,n) gives A014833 (for n>0).
%Y T(n,2^n-1) gives A131577.
%Y Cf. A329278, A363674.
%K nonn,look,tabf
%O 0,5
%A _Alois P. Heinz_, Jan 09 2020