login
A350272
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).
1
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, 32, 0, 32, 0, 32, 0, 30, 28, 30, 28, 26, 30, 30, 26, 28, 0, 104, 0, 100, 0, 104, 0, 104, 0, 100, 94, 92, 94, 94, 92, 92, 94, 94, 92, 92, 94, 344, 0, 344, 0, 336, 0, 344, 0, 344, 0, 336, 0
OFFSET
1,3
COMMENTS
a(n) is even for n > 1.
EXAMPLE
Triangle begins:
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, 32, 0, 32, 0, 32, 0;
30, 28, 30, 28, 26, 30, 30, 26, 28;
0, 104, 0, 100, 0, 104, 0, 104, 0, 100;
PROG
(Ruby)
def A(n)
ary = Array.new(n, 0)
[1, -1].repeated_permutation(n - 1){|i|
ary[(2..n).inject(1){|s, j| s + i[j - 2] * j} % n] += 1
}
ary
end
def A350272(n)
(1..n).map{|i| A(i)}.flatten
end
p A350272(10)
CROSSREFS
Row sums give A131577.
Column 0 gives A300190.
Sequence in context: A102706 A105673 A259761 * A171933 A074823 A226177
KEYWORD
nonn,tabl
AUTHOR
Seiichi Manyama, Dec 22 2021
STATUS
approved