I came up with cute expression for totient, which in addition to being cute,
also seems faster than 5&p. (in j601)
Here it is:
tot=:(- ~:)&.q:
(5&p: -: tot) 2+i.100000x
1
6!:2 '5 p: 2+i.100000x'
2.51881
6!:2 '(- ~:)&.q: 2+i.100000x'
0.676987
6!:2 '5 p: 2+i.100000'
0.409061
6!:2 '(- ~:)&.q: 2+i.100000'
0.195733
_________________________________________________________________
Hotmail: Trusted email with Microsoft's powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141664/direct/01/
http://clk.atdmt.com/GBL/go/177141664/direct/01/
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm