Pregunta de entrevista de Bloomberg

Without using loops & counters, how do you solve this specific problem.