Prime Generating Function 2

Find the smallest positive integer n n for which the function f ( n ) = 3 n 2 + 3 n + 23 f(n)=3n^2+3n+23 is composite.


The answer is 22.

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.

1 solution

Pi Han Goh
May 28, 2015

I got the idea from Barry Cipra .

Because 3 n 2 + 3 n + 23 = 3 n ( n + 1 ) + 23 3n^2 + 3n + 23 = 3n(n+ 1) + 23 is divisible by 23 23 when n = 22 n=22 , the upper bound of the answer is 22 22 . And I'm going to prove that n = 22 n=22 is the solution by showing that no smaller values of n n satisfy the condition.

Since 12 ( 3 n 2 + 3 n + 23 ) = ( 6 n + 3 ) 2 + 267 12(3n^2+3n+ 23) = (6n+3)^2 + 267 , we just need to show that 267 -267 is a quadratic non-residue mod odd primes less than 23 23 but bigger than 3 3 . A trivial substitution of n = 3 n=3 shows that it's prime.

If p 3 n 2 + 3 n + 23 p | 3n^2 + 3n + 23 , then ( 6 n + 3 ) 2 + 267 0 ( m o d p ) (6n+3)^2 + 267 \equiv 0 \pmod p , which means that 267 -267 is a square modulo p p . When n = 23 , 3 n 2 + 3 n + 23 = 1679 n=23, 3n^2 + 3n + 23 = 1679 , so if any of them were composite, it would have a prime factor less than 1679 40.97 \sqrt{1679} \approx 40.97 .

That prime factor would have to be odd, since it's clear that 3 n 2 + 3 n + 23 3n^2 + 3n + 23 is always odd, this would require 267 -267 to be a quadratic residue for some odd prime less than 40 40 but bigger than n = 3 n=3 . So it suffices to compute the Legendre symbol ( 267 p ) \left( \frac{-267}p \right) for p = 5 , 7 , 11 , 13 , 17 , 19 , 23 , 29 , 31 , 37 p=5,7,11,13,17,19,23,29,31,37 and show that it's 1 -1 for all cases.

With the help of law of quadratic reciprocity.

when p = 5 p=5 , ( 267 5 ) ( 3 5 ) 3 5 1 2 1 \left( \frac{-267}{5} \right) \equiv \left( \frac{3}{5} \right)\equiv 3^{ \frac{5-1}2 } \equiv -1 .

when p = 7 p=7 , ( 267 7 ) ( 1 7 ) 1 \left( \frac{-267}{7} \right) \equiv \left( \frac{-1}{7} \right) \equiv -1 .

when p = 11 p=11 , ( 267 11 ) ( 3 11 ) ( 3 11 ) ( 11 3 ) ( 1 3 ) 1 \left( \frac{-267}{11} \right) \equiv \left( \frac{-3}{11} \right)\equiv -\left( \frac{3}{11} \right)\equiv \left( \frac{11}{3} \right)\equiv \left( \frac{-1}{3} \right) \equiv -1 .

when p = 13 p=13 , ( 267 13 ) ( 7 13 ) ( 7 13 ) ( 13 7 ) ( 1 7 ) 1 \left( \frac{-267}{13} \right) \equiv \left( \frac{-7}{13} \right)\equiv -\left( \frac{7}{13} \right) \equiv-\left( \frac{13}{7} \right) \equiv - \left( \frac{1}{7} \right) \equiv -1 .

when p = 17 p=17 , ( 267 17 ) ( 12 17 ) ( 5 17 ) ( 17 5 ) ( 2 5 ) 2 4 2 1 \left( \frac{-267}{17} \right) \equiv \left( \frac{-12}{17} \right)\equiv \left( \frac{5}{17} \right) \equiv \left( \frac{17}{5} \right)\equiv \left( \frac{2}{5} \right) \equiv 2^{\frac42} \equiv -1 .

when p = 19 p=19 , ( 267 19 ) ( 1 19 ) ( 1 ) 19 1 2 1 \left( \frac{-267}{19} \right) \equiv \left( \frac{-1}{19} \right)\equiv (-1)^{\frac{19-1}2} \equiv -1 .

when p = 23 p=23 , ( 267 23 ) ( 6 23 ) ( 17 23 ) ( 23 17 ) ( 6 17 ) 6 8 2 4 1 \left( \frac{-267}{23} \right) \equiv \left( \frac{-6}{23} \right) \equiv \left( \frac{17 }{23} \right) \equiv \left( \frac{23}{17} \right) \equiv \left( \frac{6}{17} \right) \equiv 6^8 \equiv 2^4 \equiv -1 .

when p = 29 p=29 , ( 267 29 ) ( 23 29 ) 2 3 14 2 3 14 6 14 7 7 1 \left( \frac{-267}{29} \right) \equiv - \left( \frac{23}{29} \right) \equiv 23^{14} \equiv -23^{14} \equiv -6^{14} \equiv -7^7 \equiv -1 .

when p = 31 p=31 , ( 267 31 ) ( 12 31 ) ( 3 31 ) ( 31 3 ) 1 \left( \frac{-267}{31} \right) \equiv \left( \frac{12}{31} \right)\equiv \left( \frac{3}{31} \right) \equiv - \left( \frac{31}{3} \right) \equiv -1 .

when p = 37 p=37 , ( 267 37 ) ( 8 37 ) ( 29 37 ) ( 37 29 ) ( 8 29 ) ( 2 29 ) 2 14 3 2 16 1 \left( \frac{-267}{37} \right) \equiv -\left( \frac{8}{37} \right)\equiv \left( \frac{29}{37} \right)\equiv \left( \frac{37}{29} \right)\equiv \left( \frac{8}{29} \right)\equiv \left( \frac{2}{29} \right)\equiv 2^{14} \equiv 3^2 \cdot 16 \equiv -1 .

Hence, we have shown that no prime numbers less than 40 40 divide the expression, thus 22 22 is the smallest such integer.

Moderator note:

Thanks for showing a proof via quadratic residues.

Arguably, it would be easier to bound it by 23, and then check small cases.

Challenge Master: Yes, I'm just showing a systematic way to solve this by only checking for prime numbers below the upper bound (of n = 23 n=23 ). It would be extremely impractical to solve for other prime generating functions like this, 8 n 2 488 n + 7243 8n^2-488n+7243 when the number becomes ridiculously large and determining the primality by hand becomes very tedious (Polynomial extracted from Mathworld Wolfram ). I'm curious though, is there a way to solve for other polynomials when the degrees increases? Is there such a thing as cubic residues, quartic residues, and so on? If yes, how am I supposed to approach it, that is, how am I suppose to isolate the constant term (like what I did with the number 267 267 )?

Pi Han Goh - 6 years ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...