1

According to OEIS Sequence A002822(https://oeis.org/A002822), it states that $6n+1$ is a twin prime $iff$ $n$ is not of the form $6ab \pm a \pm b$. I was wondering if anyone had a proof for this.

Thanks!

1 Answers1

3

One must specify here: $a, b$ are positive integers. Obviously $a=0,b=n$ does not qualify.

If $n = 6ab + a + b$, then $6n+1 = (6a+1)(6b+1)$ is composite. Similarly, if $n = 6ab -a - b$, $6n+1 = (6a-1)(6b-1)$ is composite. If $n = 6ab-a+b$ then $6n-1 = (6a+1)(6b-1)$ is composite, and if $n=6ab+a-b$ then $6n-1=(6a-1)(6b+1)$ is composite.

Conversely, if $6n\pm 1 = xy$ for some integers $x,y > 1$, $x$ and $y$ must be coprime to $6$, thus $\equiv \pm 1 \mod 6$, so $x = 6a \pm 1$ and $y = 6b\pm 1$, with $a,b$ positive integers to make $x,y>1$. Then $6n \pm 1=(6a \pm 1)(6b \pm 1)$ leads to $n = 6ab \pm a \pm b$.

Robert Israel
  • 448,999
  • I was just wondering whether the claim should be "$6n +1$ isn't a prime iff $n$ is not of the form $6ab \pm a \pm b$."? – Stefan4024 Jul 01 '16 at 19:47
  • 2
    $6n+1$ is not a prime iff $n$ is of the form $6ab + a + b$ or $6ab - a - b$. $6n-1$ is not a prime iff $n$ is of the form $6ab - a + b$ or $6ab + a - b$. $6n-1$ and $6n+1$ are both primes iff $n$ is of none of those four forms. – Robert Israel Jul 01 '16 at 21:27