Legendre prime counting function: Difference between revisions
→{{header|Wren}}: Updated timing info following improvement in library functions.
(→{{header|Wren}}: Updated timing info following improvement in library functions.) |
|||
Line 488:
This runs in about 5.7 seconds which is not too bad for the Wren interpreter. As map keys cannot be lists, the Cantor pairing function has been used to represent [x, a] which is considerably faster than using a string based approach for memoization.
To sieve a billion numbers and then count the primes up to 10^k would take
<lang ecmascript>import "/math" for Int
|