Pregunta de entrevista de Aquis Exchange

A mathematics and a coding question