Problem

Source: Baltic Way 2023/7

Tags: combinatorics



A robot moves in the plane in a straight line, but every one meter it turns $90^{\circ}$ to the right or to the left. At some point it reaches its starting point without having visited any other point more than once, and stops immediately. What are the possible path lengths of the robot?