Bonus Problem 2

advertisement
Paul Avery
PHY3101
Fall 2015
Name (PRINT):
Bonus Problem 2
Due Monday, Sep. 28, 2015
For all problems
(1) Describe what software you used
(2) Show the program, including a screenshot or printout. Make sure it is readable with large
fonts and good contrast. I can’t grade it if I can’t easily read the screenshot.
∞
1. (5 pts) Find an exact expression for
1
∑ n14 .
n=1
2. (5 pts) Find the 12th derivative of e− x
3.
2
/2
in factored form.
(10 pts) Write a program to find all the prime numbers up to 10000. A simple way to do this
is to loop through each integer (is there a better way to loop?), test each integer by dividing it
by all the primes up through n (why is that sufficient?). If it is divisible, skip it and move
to the next integer. If no primes divide it, then the integer is prime and you add it to your list
of primes and move to the next integer. In this way you can build your list of primes. Other
approaches can be tried, including a simple sieve method that doesn’t require integer division.
When you are finished, print out (1) the number of primes and (2) the entire list. Don’t print
the primes one per line because there are more than 1000 primes in the list.
1
Download