|
|
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
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
a(n) is even for n > 1.
|
|
LINKS
|
|
|
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
(1..n).map{|i| A(i)}.flatten
end
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|