Pseudo code for recursive function to print prime numbers

Assignment Help Programming Languages
Reference no: EM1396683

Write in pseudo code the recursive function which receive 2 integers (a and b) and returns sum of all common prime dividers (1 is not prime). For example:

a = 48, b = 60
48=2*2*2*2*3
60=2*2*3*5
The function returns 7=2+2+3

If we write all the natural numbers below 10 which are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Determine the sum of all multiples of 3 or 5 below 1000. What is the right answer?

Reference no: EM1396683

Questions Cloud

Analysis of the hold up problem : What does the analysis of the 'hold up' problem contribute to the explanation of the size and scope of firms?
Normally distributed population with a mean : Assume that a population is normally distributed with a mean of 100 and a standard deviation of 15. Would it be unusual for the mean of a sample of 3 to be 115 or more? Why or why not?
List properties of those materials that made them suitable : Identify two materials (biomaterials) used in the development of bioengineered products (for example, polycaprolactone, collagen).
Prediction of sat by regression approch : The correlation between IQ and the verbal SAT score among the seniors at GWB High School is .90; it is significant. The mean IQ is 100 with a standard deviation of 10.
Pseudo code for recursive function to print prime numbers : Write in pseudo code the recursive function which receive 2 integers (a and b) and returns sum of all common prime dividers (1 is not prime).
Determine the solubility of the amino acids : Butanol:Water:Glacial Acetic Acid (65:20:15) was used as TLC solvent, where the stationary phase was silica. The TLC was done for identification of amino acids.
Use of sensitivity analysis and postoptimality analysis : Describe the use of sensitivity analysis and postoptimality analysis in analyzing the results. Describe the characteristics of a Bernoulli process. How is a Bernoulli process associated with the binomial distribution?
Constructing a probability tree : An accounting firm has recently recruited six graduates: three men and three women. Three of the graduates are to be selected at random to work in the firms suburban office. Construct a probability tree.
Hypotheses for the role of rna silencing : In what two different ways do bacteria "sense" the amount of trp in the environment? Describe both mechanisms in detail. What are two hypotheses for the role of RNA silencing.

Reviews

Write a Review

Programming Languages Questions & Answers

  Xhtml page to display current date time in client-s computer

Create the XHTML page which will display current date time in client's computer. Use document.write method in immediate script.

  Write script in unix to monitor creation of pdf in directory

Write script in unix which monitors creation of .pdf or PDF file in current directory. Every minute it must display list of these filenames created after previous display a list.

  Program-inputting data from files-writing-calling functions

This program will give you practice inputting data from files, writing and calling functions, using linked lists and outputting data to a file. You should only use one linked list of structs.

  Design a website to allow calculation of areas

Design a website to permit calculation of areas. A radio button list can be used to allow the user select what type of area to be calculated. Once the selection is done, the input text boxes should be displayed with the proper labels.

  User defined function to calculate average of three scores

A user defined function that will calculate and display the average of the 3 scores that remain after dropping the highest and lowest scores the performer received.

  Write a program to enter series of numbers

Write a program that ask the user to enter a series of numbers ending with -1. After the -1 is input, program should print how many numbers are even and how many numbers are odd.

  Write the program to display company-s payroll report

Write down the program to display company's payroll report in list box. The program must read each employee's name, hourly rate, and hours worked from file and produce report in a table format.

  Function to calculate recurrence using dynamic programming

Write down a function to calculate the following recurrence by using dynamic programming. PN = PN-1 + 2PN-2, with P1 = P0 = 1.

  Program to print total balances forward and total withdrawal

At the end of report, print total balances forward, total deposits, total interest earned, total withdrawals and total final account balances.

  Write program with procedure which draws shape

Write down program with procedure which draws a shape of your choice. Your program must then call the procedure 10 times to draw the shape at 10 random locations.

  Program-function definition which has three int arguments

Your program will include a function definition that has three int arguments consisting of the whole dollar portion of the price and the two integers that make up the fraction part.

  Write function to accept single argument-find prime number

Write down function named isPrime( num ) which accepts the single argument (num) and returns True if argument is prime, and False otherwise.

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