Recreational APL: Goldbach s Conjecture Steven J. Halasz One of the great things about APL is that it s an excellent way to pass the time of day. As a professional APL programmer, chances are you finish your work most days by eleven in the morning. Email and Usenet will take you through noon, but by afternoon, checking your EBay auctions every five minutes gets tiresome and you ll be desperate for something to occupy your mind. I find that playing around with prime numbers is ideal for this purpose. Goldbach s Conjecture postulates that every even number greater than 2 is the sum of two primes (see mathworld.wolfram.com/GoldbachConjecture.html for a more precise exposition of the problem). The number 1 is not considered prime, else the number 2 would also qualify as the sum of two primes. You can prove this conjecture for small numbers as follows: ÂIO 1 N 100 test maximum E 2Ã1 ¡Â¼N÷2 even numbers > 2 P Primes N primes ^/E¹P°.+P all evens are sums 1 collection of series. The following APL expression for generating primes makes this apparent: (~I¹I°.ÃI)/I 1 ¡Â¼20 2 3 5 7 11 13 17 19 Look at the Donut,
/lp/association-for-computing-machinery/recreational-apl-goldbach-s-conjecture-iRsaIQBZDO