HP49-50G Willan's formulae to find p(n), the n-th prime number
|
05-20-2024, 01:15 AM
Post: #9
|
|||
|
|||
RE: HP49-50G Willan's formulae to find p(n), the n-th prime number
pi(x) = n ≈ x/ln(x) --> x has size around n*ln(n)
n^2 upper limit is more than enough. (there are more complicated, better one) Code: from gmpy2 import * p2> for i in range(1,10): print i, prime(i) ... 1 2.0 2 3.0 3 5.0 4 7.0 5 11.0 6 13.0 7 17.0 8 19.0 9 23.0 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)