Legendre prime counting function: Difference between revisions

m
J: a note of explanation
m (J: bugfix -- powers of 10 are not prime)
m (J: a note of explanation)
Line 439:
10^8: 5761455
10^9: 50847534</lang>
 
A complete implementation of the legendre prime counting function would be <tt>(1&p: + p:inv)</tt>:
 
<lang J> (1&p: + p:inv) 10
4
(1&p: + p:inv) 11
5</lang>
 
But we can simplify that to p:inv when we know that primes are not being tested.
 
=={{header|jq}}==
6,962

edits