PROJECT EULER · #0622
Riffle Shuffles
A riffle shuffle is executed as follows: a deck of cards is split into two equal halves, with the top half taken in the left hand and the bottom half taken in the right hand. Next, the cards are interleaved exactly, with the top card in the right half inserted just after the top card in the left half, the 2nd card in the right half just after the 2nd card in the left half, etc. (Note that this process preserves the location of the top and bottom card of the deck)
Let
Amazingly, a standard deck of
Find the sum of all values of n that satisfy
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.