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.

A288693 Number of n-digit biquanimous strings using digits {0,1,...,n}.

Original entry on oeis.org

1, 1, 3, 19, 201, 2841, 48245, 939863, 20341201, 487875964, 12830282835, 370205055144, 11629998323185, 396693714869323, 14593231979817751, 576427808563042857
Offset: 0

Views

Author

Alois P. Heinz, Jun 13 2017

Keywords

Comments

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

Examples

			a(2) = 3: 00, 11, 22.
a(3) = 19: 000, 011, 022, 033, 101, 110, 112, 121, 123, 132, 202, 211, 213, 220, 231, 303, 312, 321, 330.
		

Crossrefs

Main diagonal of A288638.

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-> b(n$2, {0}):
    seq(a(n), n=0..10);
  • 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_] := b[n, n, {0}];
    Table[Print[n, " ", a[n]]; a[n], {n, 0, 10}] (* Jean-François Alcover, May 17 2022, after Alois P. Heinz *)