Obviously I don't completely understand the PS1B assignment. Can someone explain to me what exactly is the ratio they are looking for and why it slowly gets closer to 1 ?! I'll include the code I have so far. Pastebin link : http://pastebin.com/pjRqW0rn
The Pset explained the why: "There is a cute result from number theory that states .... " you want to keep a running total/sum of the log of each prime that you find so; find all the primes less than 100 ratio100 = the sum of the logs of each of those primes divided by 100 find all the primes less than 1000 ratio1000 = the sum of the logs of each of those primes divided by 1000 ratio1000 should be closer to one than ratio100
Thn for the explanation....I will rewrite my code and see if the result is there !!
Finally got it !!! I was taking N for the number of primes FOUND....and mixed up the ratio ! Once again thnx for explanation !!!
Join our real-time social learning platform and learn together with your friends!