Two Sigma interview question

Coding skills, number theory questions