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.

A286209 Number of n X 1 0..1 arrays with the number of 1's king-move adjacent to some 0 two less than the number of 0's adjacent to some 1.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 3, 10, 24, 60, 134, 304, 656, 1420, 2996, 6312, 13112, 27167, 55825, 114412, 233282, 474563, 962159, 1947098, 3931288, 7925708, 15952866, 32072580, 64404708, 129213082, 259009006, 518818124, 1038549912, 2077775396, 4154785904, 8304424080
Offset: 0

Views

Author

R. H. Hardin, May 04 2017

Keywords

Examples

			All solutions for n=7
..0. .0. .0
..1. .0. .1
..0. .1. .0
..0. .0. .0
..0. .0. .1
..1. .1. .0
..0. .0. .0
		

Crossrefs

Column k=1 of A286216.
Column k=2 of A307796.

Programs

  • Maple
    b:= proc(n, t, h, c) option remember; `if`(abs(c-2)>n, 0, `if`(n=0, 1,
          b(n-1, [1, 3, 1][t], 2, c-`if`(h=3, 1, 0))+
          b(n-1, 2, [1, 3, 1][h], c+`if`(t=3, 1, 0))))
        end:
    a:= n-> b(n, 1$2, 0):
    seq(a(n), n=0..40);  # Alois P. Heinz, Apr 29 2019
  • Mathematica
    b[n_, t_, h_, c_] := b[n, t, h, c] = If[Abs[c - 2] > n, 0, If[n == 0, 1,
         b[n - 1, {1, 3, 1}[[t]], 2, c - If[h == 3, 1, 0]] +
         b[n - 1, 2, {1, 3, 1}[[h]], c + If[t == 3, 1, 0]]]];
    a[n_] := b[n, 1, 1, 0];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Jun 27 2022, after Alois P. Heinz *)