Jane Street interview question

Math puzzles