Implement the formulas using Java Language
CS285
Discrete Mathematics Applications
Project 1
Consider a polynomial F(x)=x2+x+41. Let’s check its values for a few first integers:
F(1)=43 which is prime.
F(2)=47 which is also prime. F(3)=53, F(4)=61, F(5)=71, F(6)=83, F(7)=97, F(8)=113, F(9)=131, all of which are prime.
Is it right to conclude that F(x) is a prime for all integer x?
Let’s check a couple more values: F(10)=151 is a prime; F(11)=173 and F(12)=197 are both prime. However, it’s wrong to conclude that F(x) is prime for all integer x. In fact, F(40)=40⋅40+40+41=40⋅(40+1)+41=412.
Still, it’s interesting that F(x) is prime for all integers from 1 through 39.
G(x)=x2−x+41 is prime for x from 0 through 40, and H(x)=x2−79x+1601 is prime for x from 1through 80. H(81)=41⋅43. 80 is a long run of primes indeed.
Objective:
- Perform a research on the most recent prime numbers generator formulas (at least 7 formulas)
- Implement the formulas using Java Language
- Test your formulas for the first 10 000 Numbers
- Show your results as follow:
- Which formulas generate most of prime numbers
- Which formulas provide the first non-prime number
- Time to compute all prime numbers (up to 10 000 first numbers)
Your program should provide possibility to call via menu any of the above mentioned formulas, execute on the given datasets and provide:
What to submit:
- Report (4 pages maximum) containing results of different formulas on each datasets (template will be provided later on LMS)
- Description of each formulas and it’s reference
- Description of each code (details of class, methods, ..)
- Your Java code (documented code!!!!)
- PPT presentation (no more than 6 slides)
How to work:
2 students per project
When to submit:
Date of submission: 6th December 2021
Date of presentation: 6th December 2021