Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site uwvax.ARPA Path: utzoo!linus!decvax!harpo!seismo!uwvax!greg From: greg@uwvax.ARPA (Greg Johnson) Newsgroups: net.lang.apl Subject: A cute little problem Message-ID: <1026@uwvax.ARPA> Date: Wed, 17-Aug-83 00:37:53 EDT Article-I.D.: uwvax.1026 Posted: Wed Aug 17 00:37:53 1983 Date-Received: Thu, 11-Aug-83 17:01:26 EDT Organization: U of Wisconsin CS Dept Lines: 29 Here's a cute problem I just saw in a magazine called APL Market News. For any positive integer N, compute the sum of 1 through N-1. The problem is to find a short APL expression to do this. Believe it or not, this can be done using three characters, one of which is 'N'! (That was a hint.) The solution follows (after some space to give you time to stop this so you can think about it.) | | | | | | | | | | | | v The solution: 2!N The problem and solution were submitted to the magazine by Kevin Farrell of Long Beach, Ca. Greg Johnson U. of Wisconsin - Madison ...seismo!uwvax!greg greg@uwisc