OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..3573
EXAMPLE
a(8) = 70: 00000000, 00000001, 00000011, 00000110, 00000111, 00001100, 00001110, 00001111, 00011000, 00011001, 00011100, 00011110, 00011111, 00110000, 00110001, 00110011, 00111000, 00111001, 00111100, 00111110, 00111111, 01100000, 01100001, 01100011, 01100110, 01100111, 01110000, 01110001, 01110011, 01111000, 01111001, 01111100, 01111110, 01111111, 10000000, 10000001, 10000011, 10000110, 10000111, 10001100, 10001110, 10001111, 10011000, 10011001, 10011100, 10011110, 10011111, 10101101, 10110101, 11000000, 11000001, 11000011, 11000110, 11000111, 11001100, 11001110, 11001111, 11100000, 11100001, 11100011, 11100110, 11100111, 11110000, 11110001, 11110011, 11111000, 11111001, 11111100, 11111110, 11111111.
MAPLE
b:= proc(n, t, h, c) option remember; `if`(abs(c)>3*n, 0,
`if`(n=0, 1, b(n-1, [1, 3, 1][t], 2, c-`if`(h=3, 3, 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..50);
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Apr 29 2019
STATUS
approved