Google Interview Question

A simple mathy question, and a simple algorithm question