Determine if a number is prime

Assignment Help Business Economics
Reference no: EM131399885

Python Loops

Part 1: Determine if a number is Prime

A positive whole number, n > 2, is prime if no number between 2 and the square root of (inclusive) evenly divides n.  Write a program that accepts a value of n as input, and determines if the value is prime.  If n is no prime, your program should quit as soon as it finds a value that evenly divides n.

Part 2: Lists of Prime Numbers

Modify your program to find every prime number less than or equal to n. [Hint: add an outer loop]

Part 3: Goldbach Conjecture  (BONUS  20 pts Extra Credit)

The Goldbach conjecture asserts that every even number is the sum of two prime numbers.  Write  a program that gets a number from the user, checks to make sure that it is even, then finds two prime numbers that add up to the number.

Reference no: EM131399885

Questions Cloud

How do you think the single value system would work : How do you think the "Single Value System" would work in your own words? Is Brustien's "Single Value System" a more thoughtful and socially uplifting approach to the way we should be telling stories?
Explain four of the different knowledge output : Identify and briefly explain four of the different knowledge output representation methods (ch3). when would one choose decision trees instead of a pivot table for summary output? Compare the two methods in terms of the scenarios in which one woul..
Discuss about the training effectiveness : Go to the Chief Learning Officer's (CLO) Website and read the article titled "Southwest Airlines: Employee Education Takes Flight". Next, determine if Southwest's method of training is an effective way to conduct training. Support your position. P..
Describe leadership skills- ethics and communication : Write a three to four (3-4) page paper in which you:The intention of this assignment is to describe leadership skills, ethics, and communication which impact motivation and improve ethical performance.
Determine if a number is prime : A positive whole number, n > 2, is prime if no number between 2 and the square root of (inclusive) evenly divides n.  Write a program that accepts a value of n as input, and determines if the value is prime.  If n is no prime, your program should ..
What is the purpose of an aup policy : What is the purpose of an AUP policy? What is the purpose of a comprehensive policy?
Why is it important to measure the early reading skill : Describe the purpose of the assessment. What is it supposed to measure? The procedures of the assessment. How would you administer it? Why is it important to measure this early reading skill?
Discuss what parts of his vision are most intriguing to you : Watch Dr. Michio Kaku Video. Discuss what parts of his vision are most intriguing to you. Also discuss which part of his vision is most likely to come true by 2060.
Relationship between ethics and the law : Do you think the views on ethics and morality are separate and independent of each other? Also, in your opinion, what is the relationship between ethics and the law?

Reviews

Write a Review

Business Economics Questions & Answers

  Countrys political-economic environment and risk

What is the relationship between a country’s political/economic environment and risk? What about corruption? Please provide examples to support your post!

  Characteristics represent monopolistic competition

State whether the following characteristics represent monopolistic competition, oligopoly, or both.

  Significance of price in free market economic system

Competition among businesses has never been greater. Identify and describe several ways that businesses can become more competitive. Explain the significance of “price” in a free market economic system. Describe and provide examples of 3 different st..

  Deflationary spiral-what is the liquidity trap

What is the liquidity trap and why is it so dangerous? How does expected deflation set a floor on the real interest rate that the Fed can set? Why is fiscal policy crucial in a liquidity trap? What is meant by a deflationary spiral.

  Unique hypothetical weighted average cost of capital

Give an example of a companies unique hypothetical weighted average cost of capital (WACC) and rate of return. Recommend whether or not the company should expand, and defend your position

  A system of deposit insurance

A system of deposit insurance:

  What would the annualized standard return be

Suppose that, over a 564 day period, Mike Inc.'s stock price experienced (negative) Log Returns of -14%. Convert the Log Return into a Standard Return. What would the annualized Standard Return be?

  Sells the resulting output of cookies

Write down an expression for the profit GBC will make if it uses L units of labor at $1 an hour and sells the resulting output of cookies at $p a cookie.

  Aid is not effective in increasing incomes

We can see that aid to Africa has increased significantly over the last 40 years and that incomes in Africa have stagnated. Explain why these two facts do not constitute proof that aid is not effective in increasing incomes in Africa.

  Calculate the cross elasticity of demand

Income per year: $60,000 $60,000 $80,000 Movie Ticket Price: $11 $13 $13 Rounds of Golf: Quantity Demanded Quantity Demanded Quantity Demanded Price = $50 15 10 15 Price = $35 25 15 30 Price = $20 40 20 50 a. Using the data under D1 and D2, calculate..

  Graph the marginal cost curve for plant-resulting total cost

The manager of Green Chemical Co. has been informed that this year’s production target Q for organic fertilizer (in millions of tonnes) is 20. The manager is asked to allocate the production across the company’s two plants. How should the manager all..

  Price elasticity of demand

What must she/he expect to happen to short term interest rates over the coming year.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd