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.

A288638 Number A(n,k) of n-digit biquanimous strings using digits {0,1,...,k}; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 4, 1, 1, 1, 4, 10, 8, 1, 1, 1, 5, 19, 33, 16, 1, 1, 1, 6, 31, 92, 106, 32, 1, 1, 1, 7, 46, 201, 421, 333, 64, 1, 1, 1, 8, 64, 376, 1206, 1830, 1030, 128, 1, 1, 1, 9, 85, 633, 2841, 6751, 7687, 3153, 256, 1
Offset: 0

Views

Author

Alois P. Heinz, Jun 12 2017

Keywords

Comments

A biquanimous string is a string whose digits can be split into two groups with equal sums.

Examples

			A(2,2) = 3: 00, 11, 22.
A(3,2) = 10: 000, 011, 022, 101, 110, 112, 121, 202, 211, 220.
A(3,3) = 19: 000, 011, 022, 033, 101, 110, 112, 121, 123, 132, 202, 211, 213, 220, 231, 303, 312, 321, 330.
A(4,1) = 8: 0000, 0011, 0101, 0110, 1001, 1010, 1100, 1111.
Square array A(n,k) begins:
  1,  1,    1,    1,     1,      1,      1,      1, ...
  1,  1,    1,    1,     1,      1,      1,      1, ...
  1,  2,    3,    4,     5,      6,      7,      8, ...
  1,  4,   10,   19,    31,     46,     64,     85, ...
  1,  8,   33,   92,   201,    376,    633,    988, ...
  1, 16,  106,  421,  1206,   2841,   5801,  10696, ...
  1, 32,  333, 1830,  6751,  19718,  48245, 104676, ...
  1, 64, 1030, 7687, 36051, 128535, 372345, 939863, ...
		

Crossrefs

Rows n=0+1,2-3 give: A000012, A000027(k+1), A005448(k+1).
Main diagonal gives A288693.

Programs

  • Maple
    b:= proc(n, k, s) option remember;
          `if`(n=0, `if`(s={}, 0, 1), add(b(n-1, k, select(y->
           y<=(n-1)*k, map(x-> [abs(x-i), x+i][], s))), i=0..k))
        end:
    A:= (n, k)-> b(n, k, {0}):
    seq(seq(A(n, d-n), n=0..d), d=0..12);
  • Mathematica
    b[n_, k_, s_] := b[n, k, s] = If[n == 0, If[s == {}, 0, 1], Sum[b[n-1, k, Select[Flatten[{Abs[#-i], #+i}& /@ s], # <= (n-1)*k&]], {i, 0, k}]];
    A[n_, k_] := b[n, k, {0}];
    Table[A[n, d-n], {d, 0, 10}, {n, 0, d}] // Flatten (* Jean-François Alcover, Jun 08 2018, from Maple *)