# B Do Prime Numbers Follow a Pattern?

#### Raschedian

Hello everyone!

I was going through a simple high school level mathematics book and got to the following question:

n2 - n + 41 is a prime for all positive integers n.

You're supposed to find a counter-example and prove the statement false.

You could of course sit and enter different values for n until you get a composite number and then use that value of n as the counter-example.

But is there a way to find some pattern or rule for prime or composite numbers so that you don't have to do the work manually? This is probably a trivial question but I got curious. Thank you!

#### phyzguy

There is no known pattern or rule for calculating prime numbers, but with a little thought you should be able to easily find a counter-example without laboriously going through numbers.

#### Raschedian

There is no known pattern or rule for calculating prime numbers, but with a little thought you should be able to easily find a counter-example without laboriously going through numbers.
Thank you!

#### Mark44

Mentor
I was going through a simple high school level mathematics book and got to the following question:

n2 - n + 41 is a prime for all positive integers n.

You're supposed to find a counter-example and prove the statement false.
It's pretty easy to find a counterexample for the formula above, if you think about it. A similar formula is the following: n2 + n + 41. This one also appears to generate prime numbers. It's a little harder than the first formula to spot why not all of its values are primes.

#### fbs7

Uh? Simple proof? Hmm... how come... hmmm... hmmmmm...

Ah!! It's the same reason why $n^2-n+11$ also doesn't generate prime numbers!! Haha, smart problem!

#### phyzguy

Try writing it as n(n-1) + 41. Is there a vale of n that makes it obvious this is not prime?

#### fresh_42

Mentor
2018 Award
I have once checked one of the polynomials up to $n=100$ and there are indeed disproportionately many primes as results. Does anyone know why? I mean in terms of Legendre symbols or so?

#### fbs7

Try writing it as n(n-1) + 41. Is there a vale of n that makes it obvious this is not prime?
The way I thought of this was rewriting as $n^2 + (41-n)$

#### Mark44

Mentor
The way I thought of this was rewriting as $n^2 + (41-n)$
Yes, that's probably the most straightforward way.

#### DrClaude

Mentor
The way I thought of this was rewriting as $n^2 + (41-n)$
That's what I thought also, but @phyzguy's approach allowed me to see the solution to
A similar formula is the following: n2 + n + 41. This one also appears to generate prime numbers. It's a little harder than the first formula to spot why not all of its values are primes.

#### fbs7

Hmm... I'm kinda missing the $n*(n-1)+41$... how does that make it non-prime... hmm... 21*20?... 11*10?...hmm... can't be that... 41*40?... oh.. .41*40+41!!! hahaha... I got it! ... I'm so slow

It's actually the same thing as $n*(n+1)+41$, I guess!

#### Mark44

Mentor
Hmm... I'm kinda missing the $n*(n-1)+41$... how does that make it non-prime... hmm... 21*20?... 11*10?...hmm... can't be that... 41*40?... oh.. .41*40+41!!! hahaha... I got it! ... I'm so slow

It's actually the same thing as $n*(n+1)+41$, I guess!
Well, maybe.
As a hint, consider that $n^2 + n + 41 = n^2 + n + 40 + 1$, where the latter expression can be written as a perfect square trinomial for some value of n.

10.

Mentor

#### fresh_42

Mentor
2018 Award
Yes, a commentary which reminds me not to write what I think.
10.

Maybe someone should tell him that $10^2\pm 10+41$ are both prime.

I read it as "n^2 - n - 41".

-- The way it's written is more immediate, though.

Reduce the last two terms to zero by setting n equal to the quantity you're subtracting.
In this case, take:
N = 41

#### alan2

Just let n=41.

"Do Prime Numbers Follow a Pattern?"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving