answersLogoWhite

0

from math import *

def testPrime(x):

factor = 2

while factor**2 <= x:

if x % factor == 0:

return False

else:

factor = factor + 1

return True

candidate = 3

primeLogSum = log(2)

n = int(raw_input("What is n? "))

while candidate < n:

if testPrime(candidate):

primeLogSum = primeLogSum + log(candidate)

candidate = candidate + 2

print primeLogSum, n, primeLogSum/n

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Where can I print some food logs?

Health food stores such as GNC can provide you with food logs. you can also go to amazon.com in order to find the most appropriate food logs for you and your family


Using logs what is 632x85.3?

632x85.3 = 53909.6


How do you control heat in woodstove?

Damper , and using fewer logs


How to arrange gas fireplace logs for optimal performance and aesthetics?

To arrange gas fireplace logs for optimal performance and aesthetics, place larger logs at the bottom and smaller logs on top. Position logs to allow for proper airflow and ensure flames can reach all logs. Consider using a log set designed for gas fireplaces for a realistic look.


How do you check booting error logs in AIX?

using the command # errpt


How did the arawaks move from one island to the other?

They did by using dug-out tree logs.


How many willow logs does it take from lvl 70-99 fletching?

I would strongly recommend using diffrent logs if you can but otherwise it probably would take at least maby 2m 1m logs which i have no clue i just like to help people with runescape


What is the number of wall logs for a rectangular log crib using the post offset design?

10


How are rotting logs similar to burning logs?

They both r logs


What are the steps involved in multiplication using logarithms?

Given X and Y, you wish to find X*Y using logarithms.Find a = log(X) and b = log(Y) to any base zCalculate c = a + bFind z^c: this is the required answer.You can take logs to any base, z. For common logs, the base is 10; for natural logs it is e (Euler's number).


How do you view encrypted Trillian chat logs?

Find your logs at C:\Program Files\Trillian\users\default\logs... (\AIM\Query, if you're using AIM). Logs are labeled by screenname (of the other person, in the format of "[screenname].log". Find the one that you want to view. Right click it and choose "Open With...", and then open the file with "Notepad." Within Trillian, you can view the logs by right-clicking the screenname and choose "View Contact History."


How long should you let pine logs dry before using to make furniture?

You have to wait about a week.