Thanks for the help.

I haven't really timed it, but it seems that doing:

# q: <: 2x ^ 607

is just about as fast as doing

pp0 <: 2x ^ 607


----- Original Message Follows -----
From: Raul Miller <[email protected]>
To: Programming forum <[email protected]>
Subject: Re: [Jprogramming] perfect power???
Date: Mon, 8 Jun 2009 12:09:15 -0400

>On Mon, Jun 8, 2009 at 10:39 AM,
>> <[email protected]> wrote: I would not think
>>it was simpler, but if the verb returned: 
>> 1 - "IS" perfect power
>> 0 - "IS NOT" perfect power
>>
>> that would be fine.
>
>Both Mike Day's and my own solutions work this way:
>
>   pp0=: *./@(0&<@#, 2&<:, 1 < +./)@(#/....@q: ::0:"0)
>
>   pp0 4
>1
>   pp0 5
>0
>
>FYI,
>
>-- 
>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

Reply via email to