Period of an Infinite Binary Expansion

POJ - 3358