MathDB
counting sequences of letters, Cs in a block

Source: VTRMC 2006 P2

June 5, 2021
combinatorics

Problem Statement

Let S(n)S(n) denote the number of sequences of length nn formed by the three letters A,B,CA,B,C with the restriction that the CC's (if any) all occur in a single block immediately following the first BB (if any). For example ABCCAAABCCAA, AAABAAAAABAA, and ABCCCCABCCCC are counted in, but ACACCBACACCB and CAAAAACAAAAA are not. Derive a simple formula for S(n)S(n) and use it to calculate S(10)S(10).