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

  Who is the intended audience of the press release

Choose your favorite company, and then review a press release made by that company (usually located on the company’s Web site). Include the link to the company’s press release within your primary post so that your fellow classmates can review it. Aft..

  How can you explain this apparent paradox

when y converted their savings into deutsche marks, y flocked to Volkswagen dealerships. How can you explain this apparent paradox.

  Profit-maximizing quantity of bentonite

Suppose that the demand for bentonite is given by Q = 40 ? 0.5P, where Q is in tons of bentonite per day and P is the price per ton. Bentonite is produced by a monopolist at a constant marginal and average total cost of $10 per ton. How much profit i..

  Claims for unemployment

Suppose that only data on in action were published but not on claims for unemployment. What would be a reaction of the USD/EUR in that case.

  Convert social security from payroll tax financing

Discuss the following quotation. "The ongoing effort to partially convert Social Security from a payroll tax financing to income tax financing by further cutting the payroll tax.... and replacing the funds with general revenues may in short order put..

  How much will the quantity of federal funds have to change

By how much will the quantity of Federal funds have to change for the equilibrium to occur at the new target rate?

  What is the annual worth of this investment

The truck's market value is expected to decrease by $2,500 each year it is in service. If the company plans to keep the truck for only two years, what is the annual worth of this investment? The MARR=18% per year.

  Create a private market for right to emit sulfur dioxide

The Chicago Board of Trade voted to create a private market for right to emit sulfur dioxide. The Clean Air Act of 1990 established a limit, beginning in 1995, on total emissions of sulfur dioxide from 110 power plants. Firms finding it relatively ex..

  Monopolistic competition-production volume capability

You compete with many firms offering similar products (monopolistic competition). An economic consulting firm has estimated the own-price elasticity for your most profitable product is -1.50. Your marginal cost is constant at $75 across most of your ..

  Clientele consists of two types of investors

Pelican Point Financial Group’s clientele consists of two types of investors. The first type of investor makes many transactions in a given year and has a net worth of over $1.5 million. These investors seek unlimited access to investment consultants..

  Economic policies and practices

The policies of the federal government influence the outcomes of the various activities in that economy. When government policies change or unplanned events occur, the resulting economic events or activity will usually change. For each of the items a..

  Terms and concepts in economics for managers

Consider firms in industries you are familiar with. Are firms in such industries price takers or price-setters? How much control do they have over the prices they charge? (150 words)

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