Question: Using c++ (a) Write a method that takes as input a natural number n and determines if n is a prime number. (b) Consider the
Using c++
(a) Write a method that takes as input a natural number n and determines if n is a prime number.
(b) Consider the sequence of prime numbers 2, 3, 5, 7, 11, 13, 17, . Let pi denote the i-th number in the sequence, i.e, p1 = 2, p2 = 3, p3 = 5, p4 = 7, p5 = 11 . For i > 0, let Ni = p1 p2 . . . pi + 1. Professor Paul Erds claims that for all i > 0, Ni is a prime number. Prove that Professor Erds is wrong. Write a computer program that produces the smallest counter-example for Professor Erds claim.MATH178 Discrete Mathematics
(a) Write a method that takes as input a natural number n and determines if n is a prime number.
(b) Consider the sequence of prime numbers 2, 3, 5, 7, 11, 13, 17, . Let pi denote the i-th number in the sequence, i.e, p1 = 2, p2 = 3, p3 = 5, p4 = 7, p5 = 11 . For i > 0, let Ni = p1 p2 . . . pi + 1. Professor Paul Erds claims that for all i > 0, Ni is a prime number. Prove that Professor Erds is wrong. Write a computer program that produces the smallest counter-example for Professor Erds claim.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
