OFFSET
0,2
COMMENTS
Piles start empty and have no height limit. A token can only be placed on top of a pile. The starting token is fixed.
Up to a(11) the terms are matching A008937(n+1).
EXAMPLE
With alternating symbols A and B on two piles (starting with A), the following states emerge after placing 4 symbols in all 2^4 possible ways:
B B
A A B B B B B B A A
B B B BB A AB BA A A AB BA A BB B B B
A_ AB AA AA AB AB AB AB BA BA BA BA AA AA BA _A
All states are different, except the 13th state is a duplicate of the 4th.
Hence a(4)=15.
PROG
(Python)
def fill(patterns, state_in, ply_nr, n_plies, n_players, n_stacks):
....if ply_nr>=n_plies:
........patterns.add(tuple(state_in))
....else:
........symbol=chr(ord('A')+ply_nr%n_players)
........for st in range(n_stacks):
............state_out=list(state_in)
............state_out[st]+=symbol
............fill(patterns, state_out, ply_nr+1, n_plies, n_players, n_stacks)
def A320452(n):
....n_plies, n_players, n_stacks = n, 2, 2
....patterns=set()
....state=[""]*n_stacks
....fill(patterns, state, 0, n_plies, n_players, n_stacks)
....return len(patterns)
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Bert Dobbelaere, Oct 20 2018
STATUS
approved