Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this is python please help # Do not change the following code. It is used to provide # a list of prime numbers for you

this is python

please help

# Do not change the following code. It is used to provide

# a list of prime numbers for you to use in the project


import sympy as sy

maxN = 50000

primes = list(sy.sieve.primerange(2,maxN+1))





#------------------------------------------------------

#------------------------------------------------------


# Part a)

# variable name: na

# Define an integer between 4 and maxN


# add code here


na = 4000


# Part b)

# variable name: factors_na

# Write a for loop to build a list of of the factors of na

# note: include 1 and na in the list


# example: na = 6, factors_na = [1,2,3,6]



# add code here




#------------------------------------------------------

#------------------------------------------------------


# Part c)

# variable name: nb

# Define an integer between 4 and maxN


# add code here



# Part d)

# variable name: prime_factors_nb

# Write a for loop to build a list of of the prime factors of nb

# note: nb is in the list if it is prime

# note: make use of the list primes above


# example: nb = 6, prime_factors_nb = [2,3]

# example: nb = 5, prime_factors_nb = [5]


# add code here


#------------------------------------------------------

#------------------------------------------------------


# Part e)

# variable name: twin_primes

# Write a for loop to build a list of of the twin primes below maxN

# hint: make use of the list primes above


# example: twin_primes = [3,5,7,11,13,17,19,29,31...]


# add code here


#------------------------------------------------------

#------------------------------------------------------


# Part f)

# variable name: factorials

# Write a for loop to build a list of factorials below maxN

# note: do not use while loops or break statements

# hint: use a binary search



# add code here




# Part g)

# variable name: factorial_primes

# Write a for loop to build a list of of the factorial primes below maxN

# hint: make use of the list primes above

# hint: make use of the list factorials above


# example: factorial_primes = [2,3,5,...]


# add code here



Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inference Control In Statistical Databases From Theory To Practice Lncs 2316

Authors: Josep Domingo-Ferrer

2002nd Edition

3540436146, 978-3540436140

More Books

Students also viewed these Databases questions

Question

What is emotion? How can it best be assessed?

Answered: 1 week ago

Question

Design a health and safety policy.

Answered: 1 week ago