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.

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).

This page as a plain text file.
%I A350272 #17 Dec 22 2021 14:16:49
%S A350272 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 A350272 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 A350272 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 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).
%C A350272 a(n) is even for n > 1.
%e A350272 Triangle begins:
%e A350272    1;
%e A350272    0,   2;
%e A350272    2,   0,  2;
%e A350272    4,   0,  4,   0;
%e A350272    4,   4,  4,   2,  2;
%e A350272    0,   8,  0,  12,  0,  12;
%e A350272   10,   8, 10,  10,  8,   8, 10;
%e A350272   32,   0, 32,   0, 32,   0, 32,   0;
%e A350272   30,  28, 30,  28, 26,  30, 30,  26, 28;
%e A350272    0, 104,  0, 100,  0, 104,  0, 104,  0, 100;
%o A350272 (Ruby)
%o A350272 def A(n)
%o A350272   ary = Array.new(n, 0)
%o A350272   [1, -1].repeated_permutation(n - 1){|i|
%o A350272     ary[(2..n).inject(1){|s, j| s + i[j - 2] * j} % n] += 1
%o A350272   }
%o A350272   ary
%o A350272 end
%o A350272 def A350272(n)
%o A350272   (1..n).map{|i| A(i)}.flatten
%o A350272 end
%o A350272 p A350272(10)
%Y A350272 Row sums give A131577.
%Y A350272 Column 0 gives A300190.
%K A350272 nonn,tabl
%O A350272 1,3
%A A350272 _Seiichi Manyama_, Dec 22 2021