>>571
n個並べた内の右端にbが来ない物の数をa
n個並べた内の右端にbが来る物の数をbとする。
An=a+b
An+1=3a+2b
An+2=8a+6b=(6a+4b)+(2a+2b)=2An+1+2An