Domanda di colloquio di Google

A simple mathy question, and a simple algorithm question