I was looking into prime numbers and i keep coming upon pi(x). Specifically How many primes are there?. It is obvious that they arent multiplying pi*x. So what are they doing? Im only in trig so please explain it in basic terms.
Li(x) is the best approximation and it has been proven that it asymptotically approaches pi(x), however Littlewood proved (in 1914?) that while for small n (n < 10^300) Li(x)-pi(x)>0, Li(x)-pi(x) changes signs infinitely many times as n --> infinity.
Maple has the Li function built in.
You say that " ", but what steps did you go through to get that? I know that it isnt pi*46000.
If you don't understand calculus, you won't understand the meaning behind the log integral, Li(n). Just know it as the best approximation for . There is no particular reason for using the notation either. There are only a limited number of letters, and they have to be recycled eventually.
The following is NOT HTML code. It was the only way I could get the forum to preserve the indentations needed for Python, which is the language this is written in.
[html]primes = 
n=input("Up to what number? ")
for j in primes:
print "Number of Primes: " + `p`[/html]
This code is not very efficient (it takes almost 1 minute for n=100000, compared to about 3 seconds on Maple), but it should at least point you in the right direction.
My Euler code to find the primes less than or equal to some limit is:
Then to find the number one just uses:Code:function primes(n) ## ## function returns a row vector containing the primes ## less than or equal n ## ## (c) Xxx Xxxxxx 1997 rewritten 2004 using MATLAB seive alg ## if size(n)!=[1,1] "n must be a scalar" rv=; return rv; endif p=[1:2:n]; q=length(p); p(1)=2; for k=3 to sqrt(n) step 2 if p((k+1)/2) p(((k*k+1)/2):k:q)=0; endif end; rv=p(nonzeros(p>0)); return rv; endfunction