feureau


Joined 1 year ago
Homeworks submitted:
Homework comments:
2
0

About Me

No description provided.

Classes

Guitar for Beginners - Playing Pink Floyd

Class status: Established
Role: Student
. 0% complete

MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming

Class status: Established
Role: Student
. 11% complete

Submitted Assignments

MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming: Lesson 2, HW 1
from math import log
from math import *
print("Begin solving Problem 1.")
def isItPrime(numberToCheck):
    for n in range(2,numberToCheck):
        if numberToCheck%n == 0 :
            return False

    return True


primes = []
primeCounter=0;
numbers = 2

while True:
    if numbers == 2 or isItPrime(numbers):
        primes.append(numbers)
        primeCounter += 1
        if primeCounter == 1000:
#solution to problem 1
            print("The thousandth prime is", numbers)
            break
    numbers += 1

print("\nBegin solving Problem 2.")

targetN=int(input("What is the target N? "))
totalLog = 0
for numbers in range(2,targetN,1):
    if numbers == 2 or isItPrime(numbers):
        totalLog += log(numbers)

#solution to problem 2
print("Sum of Log of Primes up til N is ",totalLog)
print("N is ", targetN)
print("ratio of Sum of Log of Primes to N is ", totalLog/targetN)

feureau 1 year ago
MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming: Lesson 1, HW 1
# Problem Set 0
# Name: Feureau Appleseed
# Collaborators: None
# Time: 
#
import sys

lastName = input("Enter your last name: ")
firstName = input("Enter your first name: ")
print(firstName + "\n" + lastName)

feureau 1 year ago