My Math Forum result of my prime counting function

 Number Theory Number Theory Math Forum

 April 3rd, 2019, 09:56 AM #11 Senior Member   Joined: Mar 2019 From: iran Posts: 312 Thanks: 13 for n=100000 p=317 and q=99991 when did we calculate it?
April 3rd, 2019, 10:02 AM   #12
Senior Member

Joined: Aug 2012

Posts: 2,332
Thanks: 723

Quote:
 Originally Posted by youngmath for n=100000 p=317 and q=99991 when did we calculate it?
How did "we" get enlisted for this project? It's five lines of Python.

Code:
Primes = [101, 103, etc.]  # You fill in the primes you care about.

product = 1
for prime in Primes :
product *= ((prime - 1)/prime)
print(str(product))
You initialize a list called Primes with the list of primes, which you can look up or calculate.

ps -- This is Python3, which defines '/' as real number division.

Last edited by Maschke; April 3rd, 2019 at 10:13 AM.

 April 11th, 2019, 05:52 AM #13 Senior Member   Joined: Mar 2019 From: iran Posts: 312 Thanks: 13 proof 1/2 × 2/3 × 4/5 × ... × (p-1)/p = Π (p-1)/p = Π 1-(1/p) = Π 1-p^(-1) = 1/(Π 1/(1-p^(-1))) = 1/zeta(1) = 1/( 1+1/2+1/3+...+1/p) = 1/ln(p) q=p^2 1/2 × 2/3 × 4/5 × ... × (q-1)/q = 1/ln(q) => (p-1)/p × ... × (q-1)/q = 1/ln(q) / 1/ln(p) = 1/ln(p^2) / 1/ln(p) = 1/2

 Tags counting, function, prime, result

 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post numberguru1 Number Theory 3 November 6th, 2015 01:21 PM Jonas Castillo T Number Theory 6 May 9th, 2015 06:26 PM jim198810 Number Theory 6 March 26th, 2015 07:31 PM fafa Number Theory 24 June 22nd, 2013 12:55 AM guynamedluis Number Theory 2 April 21st, 2012 12:48 PM

 Contact - Home - Forums - Cryptocurrency Forum - Top