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

Original entry on oeis.org

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

Views

Author

Seiichi Manyama, Dec 22 2021

Keywords

Comments

a(n) is even for n > 1.

Examples

			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;
		

Crossrefs

Row sums give A131577.
Column 0 gives A300190.

Programs

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