3 ms·
Using successive multiplication instead of exponent operation: 6> (each ((x (range 2 1000))) (each ((y (range 1 100)) ;; needed just for the put-line
by kazinator 8y ago
Using successive multiplication instead of exponent operation:
6> (each ((x (range 2 1000)))
(each ((y (range 1 100)) ;; needed just for the put-line
(z [giterate true (op * x) x]))
(when (= x (sum (digits z)))
(put-line `@x @y`))))
(Makes no difference; run time is vastly dominated by the contribution of the (sum (digits z)) business.)