This problem is a programming version of Problem 27 from projecteuler.net
Euler published the remarkable quadratic formula:
It turns out that the formula will produce 40 primes for the consecutive values to . However, when , is divisible by , and certainly when , is clearly divisible by .
Using computers, the incredible formula was discovered, which produces primes for the consecutive values to . The product of the coefficients, and , is .
Considering quadratics of the form:
where is the modulus/absolute value of
Find the coefficients, and , for the quadratic expression that produces the maximum number of primes for consecutive values of , starting with .
Note For this challenge you can assume solution to be unique.
The first line contains an integer .
Print the value of and separated by space.
for and , you get 42 primes.