Kona is an open-source implementation of the K programming language, a proprietary language of the APL family that uses the standard ASCII character set. K is noted for it’s succinctness and the sense of dread felt at one’s first glance. Kona’s wiki maintains solutions for the Project Euler problems in K, some with more detailed explanations. The first problem on Project Euler is:
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.The solution in K is smaller than the problem as stated:
+/&~&/(!1e3)!/:3 5
Here’s how it works.