Sollicitatievraag bij Bloomberg

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