2 using prime n write ruby function primearrayn that


A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. Goldbach conjecture claims that each even number greater than 2 is a sum of two prime numbers, like in the attached examples.

(1) Write Ruby function prime? (n) that returns true if n is prime, and false if n is not Prime.

(2) Using prime? (n) write Ruby function primearray(n) that returns an array that contains all prime numbers that are less than n.

(3) Using primearray(n) write function goldbach(even) that returns two prime numbers (prime1 and prime2) such that even = prime1 + prime2

(4) Using goldbach(even) write a main program that prints the attached table

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: 2 using prime n write ruby function primearrayn that
Reference No:- TGS02896697

Expected delivery within 24 Hours