Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can I get help? Please. Python Background: https://en.wikipedia.org/wiki/Prime_number A prime numbers is a natural number greater than 1 that is not a product of two

Can I get help? Please.

Python

Background: https://en.wikipedia.org/wiki/Prime_number A prime numbers is a natural number greater than 1 that is not a product of two smaller natural numbers 2,3,5,7,11

Note : In some calculations, it may be helpful to introduce additional variables. However, make sure that the names do not overlap with those requested in the project ------------------------------------------------------- '''

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

''' In this part of the project, you are asked to generate sequences from OEIS '''

# Part a) ---------------------------------------------------- # variable name : tribonacci # build a list of the tribonacci numbers of length 15 # hint: grow a list inside of a for-loop # reference: https://oeis.org/A000073

# add code here

# Part a) ---------------------------------------------------- # variable name : Square_pyramidal # build a list of the Square pyramidal numbers of length 15 # - use a single for loop # reference: https://oeis.org/A000330

# add code here

''' In this part of the project, we are testing if a number is prime or composite by looking at the remainders when that number is divided by smaller numbers. Note that we only have to check up to the square root of the number. '''

# Part b) ---------------------------------------------------- # variable name : number1 # define an integer between 2 and 350

# add code here

# Part b) ---------------------------------------------------- # variable name : number1_max # find the square root of number1 and cast to an integer

# add code here

# Part c) ---------------------------------------------------- # variable name : number1_remainders # use a for loop to build a list of the remainders # when number1 is divided by the numbers 2,3,4,5,...,number1_max # note: we want the remainder for number1_max included in the list

# add code here

# Part d) ---------------------------------------------------- # variable name : number1_remainders_min # find the minimum of number1_remainders

# add code here

# Part e) ---------------------------------------------------- # Use a conditional to see if number1_remainders_min is 0 # or not. # The conditional should print number1 together with its primality.

# Examples # # number1 what is printed #-------- ---------------- # 4 4 composite # 5 5 prime # 210 210 composite

# 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_2

Step: 3

blur-text-image_3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 2 Lnai 8725

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448505, 978-3662448502

More Books

Students also viewed these Databases questions

Question

4 How can you create a better online image for yourself?

Answered: 1 week ago