JATK or let's say J4F.
Generating a sequence of ordered perfect powers <= N
ref. OLEIS A001597
I have a tacit (pmt) and a explicit (pmx) version both with the same
algorithm
*nb* Without ext. prec.
pmt 200
1 4 8 9 16 25 27 32 36 49 64 81 100 121 125 128 144 169 196
10 ts 'pmt 2000000'
0.006247 232448
10 ts 'pmx 2000000'
0.0036827 275712
x:{: pmx 2e6
1999396
#pmt 1e6 NB. OLEIS A070428
1111
Testing if a number > 1 is a perfect power:
(1<[:+./[:{:__&q:) 220
0
(1<[:+./[:{:__&q:) 32
1
Just anxious to know (JATK) what's possible. :-)
=@@i
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm