[net.lang.apl] A cute little problem

greg@uwvax.ARPA (Greg Johnson) (08/17/83)

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