Apparently you did the same reasoning to come up with that solution. While
thinking about this problem I noticed that two consecutive numbers are
always realtively prime. Obvious, but I had never realized that before. Now
I am wondering about the relationships between numbers separated
by intervals other than one. And what happens if this difference is a prime
number and what happens if it is not.
It seems to me that another problem would be to find a general solution
which runs quickly for very large numbers.
On Dec 14, 2007 12:01 AM, Raul Miller <[EMAIL PROTECTED]> wrote:
> On Dec 13, 2007 8:02 PM, Don Guinn <[EMAIL PROTECTED]> wrote:
> > would not be available. So the solution is obvious without relying on
> > solution by exhaustion.
>
> Indeed.
> a.{~42+0 4 5 9 9 1 63 4 8 15 78
> (run that to see my 11 character solution for this problem.)
>
> The longer chunk of code I wrote was intended to solve the
> more general case, where 61 is replaced with an arbitrary
> positive integer.
>
> --
> Raul
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm