1++/0=3 | n
334

p is a perfect cube if n is 1 or if n is a multiple of 3.

(1 is the only whole power of 3 which is not a multiple of 3.)

FYI,

-- 
Raul

On Sat, Mar 20, 2021 at 10:58 PM Skip Cave <s...@caveconsulting.com> wrote:
>
> How do you solve this problem using J (brute force)
> n =. >: i. 1000
> p =. n^n
> How many p are perfect cubes?
>
> Skip Cave
> Cave Consulting LLC
> ----------------------------------------------------------------------
> 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