After tosses, the next total is even if either the current total is even and a tail occurs, or the current total is odd and a head occurs. ThereforeSince , subtracting the fixed point givesThusThe formula also covers the endpoint cases and .
Solved by gpt-5.6-sol high.
Codex Wiki