# Prime larger than a twin prime

Wondered whether the following equation holds true for all twin primes such that where $a$ and $b$ are twin primes and where $b=a+2$, then $3\left[\left(\frac{a+b}{2}\right)^2-1\right]+2 = NP$. Where $NP$ is a prime number?

I noticed while playing around with numbers that where

$y=(x^2)-1$ then $y=(x+1)(x-1)$. From this I found some twin primes chosen at random using the first equation above gave further larger primes.

First question on the site, so sincere apologies if the equation format is not perfect for posting here and or there are flaws in what I have observed.

• I tried to improve your post using $\LaTeX$ (for better readability). Please check whether these edits did not unintentionally change the meaning of your post. – JimmyK4542 Sep 2 '14 at 22:16
• @JimmyK4542 "whether these posts intentionally changed the meaning" Paraphrasing there, I hear people do that double negative often, just letting you know. – user142198 Sep 3 '14 at 3:45
• Sorry, I blindly copied one of the comment templates here without reading it. – JimmyK4542 Sep 3 '14 at 3:50

Let $a=41$, $b=43$. Then your candidate number is
$$3\left[42^2-1\right] + 2 = 5291=11(13)(37) \, .$$
It's not surprising that your formula gives a prime result for many small numbers. Notice that $b=a+2$, so \begin{eqnarray} 3\left[\left(\frac{a+b}{2}\right)^2-1\right]+2&=&3\left[\left(\frac{2a+2}{2}\right)^2-1\right]+2\\ &=& 3[(a+1)^2-1]+2 \\ &=& 3(a+2)(a)+2 \quad \text{(by the difference of two squares formula)}\\ &=& 3a^2+6a+2 \, . \end{eqnarray}
Now, $3a^2+6a+2$ is obviously odd whenever $a$ is odd, and can never be a multiple of $3$. It's also true (but less obvious) that it's never a multiple of $5$ or $7$. When $a$ is fairly small, this means there aren't very many prime factors left that your number could have, so it's very difficult for it not to be prime!
For $a=41$, $b=43$, $$3\left[\left(\frac{a+b}{2}\right)^2-1\right]+2 = 5291 =(11)(13)(37).$$