The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A320452 Number of possible states when placing n tokens of 2 alternating types on 2 piles. 2

%I #19 Nov 06 2018 13:26:42

%S 1,2,4,8,15,28,52,96,177,326,600,1104,2030,3732,6858,12600,23144,

%T 42504,78048,143296,263068,482904,886392,1626912,2985943,5480012,

%U 10056946,18456056,33868851,62151788,114050884,209284710,384034660

%N Number of possible states when placing n tokens of 2 alternating types on 2 piles.

%C Piles start empty and have no height limit. A token can only be placed on top of a pile. The starting token is fixed.

%C Up to a(11) the terms are matching A008937(n+1).

%e 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:

%e B B

%e A A B B B B B B A A

%e B B B BB A AB BA A A AB BA A BB B B B

%e A_ AB AA AA AB AB AB AB BA BA BA BA AA AA BA _A

%e All states are different, except the 13th state is a duplicate of the 4th.

%e Hence a(4)=15.

%o (Python)

%o def fill(patterns, state_in, ply_nr, n_plies, n_players, n_stacks):

%o ....if ply_nr>=n_plies:

%o ........patterns.add(tuple(state_in))

%o ....else:

%o ........symbol=chr(ord('A')+ply_nr%n_players)

%o ........for st in range(n_stacks):

%o ............state_out=list(state_in)

%o ............state_out[st]+=symbol

%o ............fill(patterns, state_out, ply_nr+1, n_plies, n_players, n_stacks)

%o def A320452(n):

%o ....n_plies,n_players,n_stacks = n,2,2

%o ....patterns=set()

%o ....state=[""]*n_stacks

%o ....fill(patterns, state, 0, n_plies, n_players, n_stacks)

%o ....return len(patterns)

%Y For 2 token types on 3 piles, see A320731.

%K nonn,more

%O 0,2

%A _Bert Dobbelaere_, Oct 20 2018

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 5 17:28 EDT 2024. Contains 373107 sequences. (Running on oeis4.)