Skip to content

lucky-sideburn/Prime-counting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prime-counting

Function for prime-counting with a good approximation

Alt text Alt text

From Linux command line:

git clone https://github.com/lucky-sideburn/Prime-counting.git
ruby px.rb
Example => x: 83 ; p(x): 23 ; k(x): 23.66003706554203 ; px(x)-k(x) = -0.6600370655420313 ; x/log(x) : 18.783207489664797 ; px(x) - x/log(x) 4.216792510335203

Create GnuPlot Chart:

ruby px.rb >> primes.csv 
sed -i '' 's/\./,/g' primes.csv 
gnuplot> set datafile separator ";"
gnuplot> set terminal canvas
gnuplot> set output "foo.html"
gnuplot> plot 'primes.csv' using 1:2 title 'P(x)' with lines, '' using 1:3 title 'k(x)' with lines , '' using 1:4 title 'x/log(x)' with lines

Open foo.html from you browser to see this above

About

a good approximation :)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published