Prime Number Strings

The polynomial f ( x ) = x 2 + 11 x + 47 f(x) = x^2 + 11x + 47 is a prime number for 11 consecutive integers, x = 0 , 1 , , 10 x=0,1,\ldots, 10 .

The polynomial g ( x ) = x 2 + a x + 223 g(x) = x^2 + a x + 223 is a prime number for 27 consecutive integers, x = 0 , 1 , , 26 x=0,1,\ldots, 26 .

Find the constant a a .


The answer is 27.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Mirko Očkin
May 15, 2018

27 -27 is also solution.

Giorgos K.
Apr 25, 2018

Quick search using M a t h e m a t i c a Mathematica

Select[Range@100,And@@PrimeQ@Table[223+#*g+g^2,{g,0,26}]&]

the above code returns 27 27

How do you know that the answer must be at most 100?

Pi Han Goh - 3 years, 1 month ago

Log in to reply

Let me explain it to you for the third time.
step 1 You make a brute force program
step 2 You test it in a small range (in this case 100)
step 3 If you don't get any results, you search in bigger range (say 1000 or 1000000)
step 4 If the problem is too tough then brute force don't work and you have to do maths
step 5 I am just describing the way I got the right answer
step 6 Are you obsessed with my mathematica answers???



cause many people here are interested in one-liner code solutions

Giorgos K. - 3 years, 1 month ago

Log in to reply

Maybe there's a value of a a larger than 100 that satisfies the given conditions as well?

Pi Han Goh - 3 years, 1 month ago

Log in to reply

@Pi Han Goh then the question is wrong and it should ask for the smallest integer.
Anyway many problems on this site are not well-stated (and if you know this it helps you getting the right answers)

Giorgos K. - 3 years, 1 month ago

Log in to reply

@Giorgos K. How do you know that this question isn't wrong?

Many problems? From who? The staffs or from the community?

Pi Han Goh - 3 years, 1 month ago

Log in to reply

@Pi Han Goh Obviously the person that posted this question believes that there is only one solution. ask him. It is very natural that many of the posts are problematic and that's why the community should report and clarify. I think we must end this discussion here my friend

Giorgos K. - 3 years, 1 month ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...