Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started