Search Problems   RSS Feed
projecteuler.net

Left vs Right

 Published on Saturday, 7th June 2025, 05:00 pm and solved by 495
Difficulty: Level 19 [48%]

Problem 948

Left and Right play a game with a word consisting of L's and R's, alternating turns. On Left's turn, Left can remove any positive number of letters, but not all the letters, from the left side of the word. Right does the same on Right's turn except that Right removes letters from the right side. The game continues until only one letter remains: if it is an 'L' then Left wins; if it is an 'R' then Right wins.

Let $F(n)$ be the number of words of length $n$ where the player moving first, whether it's Left or Right, will win the game if both play optimally.

You are given $F(3)=4$ and $F(8)=181$.

Find $F(60)$.



Copied to Clipboard