What is near prime let us first understand

Assignment Help Basic Computer Science
Reference no: EM131955313

The project consists of multiple portions. The first three parts consists of writing functions and the final part consists of sorting a list of numbers using those functions. They are as follows:

Part 1

A palindrome is a number which reads the same forward and backwards.

To illustrate:

10101,131,1331,1225221,2 are examples of palindromes

122,100,19 are examples of numbers which are not palindromes.

function that given a number determines if the number is a palindrome or not. Your function should take in a number and return "yes" or "no" depending if it's a palindrome or not.

Part 2

function that given a number determines if the number is near prime. To understand what is near prime let us first understand what a prime number is.

A number is prime is it is only divisible by 1 and itself.

2,5,13,23 are examples of prime numbers.

4,22,100,60 are examples of numbers which are not prime numbers.

Consider a number such as 49. It is not a prime number because it is divisible by 7. However, it is not divisible by anything else apart from 1, 7 and 49.

We call a number near prime if it is divisible by 1, itself and at most 2 other numbers. To illustrate:

49 is near prime as only 1,7 and 49 divide it.

22 is near prime as only 1,2,11,22 divide it.

4 is near prime as only 1,2,4 divide it.

60 is not near prime as 1,2,3,5,6,10,12,20,30,60 divide it.

17 is near prime as only 1,17 divide it

20 is not near prime as 1,2,4,5,10,20 divide it.

function which determines if a number is near prime or not.

Your function should take in a number and return "yes" or "no" depending if it's a near prime or not.

Reference no: EM131955313

Questions Cloud

Write program that reads records containing employee number : Write a program that reads records containing an employee number and an hourly rate for several employees and stores these in a heap.
Design a python function that will accept as input : Design a Python function that will accept as input three string values from a user. The method will return to the user a concatenation of the string values
Calculate total variable overhead cost : Calculate total variable overhead cost for May 2018. Calculate total overhead cost for the quarter April - June 2018.
Respond to post related to the neuropsychological practice : Respond to the following post related to the Neuropsychological Practice. The post is attached in a file. Please read it carefully and the respond.
What is near prime let us first understand : function that given a number determines if the number is near prime. To understand what is near prime let us first understand what a prime number is.
Calculate the loan outstanding balance : CALCULATE the Loan outstanding balance in September, Interest payment in August, Preliminary Cash balance in September
Four fundamental design principles : Explain why adhering to the four fundamental design principles are important considerations when developing secure applications.
What two things did you learn or realize about yourself : Were you convicted to get off your butt and do something different, and if so, what action/s will you take...?
Production budget-calculate total direct labor cost : Tangshang Industries production budget from the 2nd quarter of 2018, Calculate Total Direct Labor Cost for June 2018.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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