My Math Forum  

Go Back   My Math Forum > College Math Forum > Number Theory

Number Theory Number Theory Math Forum


Thanks Tree3Thanks
  • 1 Post By Sebastian Garth
  • 2 Post By Denis
Reply
 
LinkBack Thread Tools Display Modes
September 14th, 2018, 06:52 AM   #1
Newbie
 
Joined: Apr 2011

Posts: 29
Thanks: 0

Number of primes

How do computers evaluate the number of primes below a given integer?
matqkks is offline  
 
September 14th, 2018, 07:52 AM   #2
Math Team
 
Joined: Oct 2011
From: Ottawa Ontario, Canada

Posts: 13,129
Thanks: 914

How? The way it has been instructed by the programmer!
Denis is online now  
September 14th, 2018, 08:42 AM   #3
Math Team
 
topsquark's Avatar
 
Joined: May 2013
From: The Astral plane

Posts: 1,888
Thanks: 765

Math Focus: Wibbly wobbly timey-wimey stuff.
Quote:
Originally Posted by matqkks View Post
How do computers evaluate the number of primes below a given integer?
I would imagine that the computer simply uses an algorithm to find the primes. I once wrote a program in High School to do this.. using a variant on the sieve of Erasthosenes.

-Dan
topsquark is offline  
September 14th, 2018, 12:42 PM   #4
Member
 
Joined: Jul 2010

Posts: 82
Thanks: 1

If you just need a reasonable estimate N/log(N) works pretty well. More accurate approximations are covered here.
Thanks from topsquark
Sebastian Garth is offline  
September 15th, 2018, 07:19 AM   #5
Math Team
 
Joined: Oct 2011
From: Ottawa Ontario, Canada

Posts: 13,129
Thanks: 914

Quote:
Originally Posted by Sebastian Garth View Post
If you just need a reasonable estimate N/log(N) works pretty well.
N/log(N-1) is much closer.

https://primes.utm.edu/howmany.html
Thanks from Sebastian Garth and topsquark
Denis is online now  
Reply

  My Math Forum > College Math Forum > Number Theory

Tags
number, primes



Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conjecture about the number of primes uvkajed Number Theory 2 August 5th, 2015 10:51 AM
primes and twin primes: Number between powers of 10 caters Number Theory 67 March 19th, 2014 04:32 PM
problems in the primes number WORLD Number Theory 5 September 3rd, 2012 02:36 PM
number of primes in a given interval icemanfan Number Theory 12 March 3rd, 2012 04:29 PM
Primes as the seeds for any number Agno Number Theory 53 November 19th, 2011 04:10 PM





Copyright © 2018 My Math Forum. All rights reserved.