Pregunta de entrevista de Amazon

Math based question with simple calculations