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

  Change in total monthly revenue

Using your answer to part a. above, how could you have predicted this change in total monthly revenue?

  Explain how the product market effect may operate

Assume in the retail-trade industry, unionized workers earn 19.0% more than non-unionized workers do. Briefly explain how the “product market” effect may operate in this industry. If the product market effect were large, would that suggest that the 1..

  Q speedy growth of the nationwide debt alarmed various

q. speedy growth of the nationwide debt alarmed various politicians as well as created pressure for restricting

  According to behavioral economists-self-control problems

According to behavioral economists, self-control problems:

  The high price of gasoline is hurting our economy

“The high price of gasoline is hurting our economy” said Mark Kirsch, a trucker in April of 2008 when Gasoline prices were at all-time highs due to $100/bbl. + oil prices. “Its hurting middle class people.” Explain to truck drivers why a government i..

  Competitive market without government interventions

Suppose that in a competitive market without government interventions, the market equilibrium is Q* and P*. Graphically show the consumer surplus, the producer surplus and the social surplus under the following government interventions. The governmen..

  Explain the long run average cost curve

Explain the impact the law of diminishing marginal returns has on both marginal cost and average total cost - with the aid of a diagram explain the long run average cost curve and the influences upon it.

  Economic problems for practice

In an article about the financial issues of USA Today, a major magazine reported that the newspaper was losing about $20 million a year. A financial analyst said that the paper should raise its price from 50 cents to 75 cents,

  Straight line production possibility frontiers

Two nations have straight line production possibility frontiers, but with different slopes. Using a graph and an accompanying written explanation, explain why complete specialization maximizes the gains from trade between these two countries.

  Fast-food restaurants post nutrition warning labels

State whether each of the following events will cause a movement along the demand curve for Big Mac or whether it will cause the demand curve for Big Mac to shift? If the demand curve shifts, indicate whether it will shift to the left or to the right..

  Stock be worth share to make two offers equally attractive

A business executive is offered a management job at Generous Electric Company, which offers him a 5 year contract that calls for a salary of $62,000 per year, plus 600 shares of GE stock at the end of the 5 years. what must the Generous Electric stoc..

  What is the effect of freeze on the nominal-real earnings

Developed produces two goods, manufactures and food, using three factors of production: capital, land and labor. The production of manufactures requires capital and labor, while the production of food uses land and labor. All the arable land is in th..

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