%I #17 Dec 22 2021 14:16:49
%S 1,0,2,2,0,2,4,0,4,0,4,4,4,2,2,0,8,0,12,0,12,10,8,10,10,8,8,10,32,0,
%T 32,0,32,0,32,0,30,28,30,28,26,30,30,26,28,0,104,0,100,0,104,0,104,0,
%U 100,94,92,94,94,92,92,94,94,92,92,94,344,0,344,0,336,0,344,0,344,0,336,0
%N Triangle T(n,k), n >= 1, 0 <= k <= n-1, read by rows, where T(n,k) is the number of solutions to 1 +- 2 +- 3 +- ... +- n == k (mod n).
%C a(n) is even for n > 1.
%e Triangle begins:
%e 1;
%e 0, 2;
%e 2, 0, 2;
%e 4, 0, 4, 0;
%e 4, 4, 4, 2, 2;
%e 0, 8, 0, 12, 0, 12;
%e 10, 8, 10, 10, 8, 8, 10;
%e 32, 0, 32, 0, 32, 0, 32, 0;
%e 30, 28, 30, 28, 26, 30, 30, 26, 28;
%e 0, 104, 0, 100, 0, 104, 0, 104, 0, 100;
%o (Ruby)
%o def A(n)
%o ary = Array.new(n, 0)
%o [1, -1].repeated_permutation(n - 1){|i|
%o ary[(2..n).inject(1){|s, j| s + i[j - 2] * j} % n] += 1
%o }
%o ary
%o end
%o def A350272(n)
%o (1..n).map{|i| A(i)}.flatten
%o end
%o p A350272(10)
%Y Row sums give A131577.
%Y Column 0 gives A300190.
%K nonn,tabl
%O 1,3
%A _Seiichi Manyama_, Dec 22 2021
|