Determining the next Twin Prime? A really simple I question I guess. Is there an algorithm or method such that given an integer $N$ there is a way to determine the next twin prime pair greater than $N$?
If yes, then could you please explain it?
 A: Let $x=N+1$.  If $x$ and $x+2$ are prime, you're done.  If not, let $x=x+1$ and repeat.  :-P
A: Nope. As far as I know there's no algorithm beyond sieveing for primes past $N$ until you find a twin pair.
A: Since
$$\sigma_0(n−1) + \sigma_0(n+1)−4 \ge 0$$
with equality exactly when $n-1$ and $n+1$ are both primes, what about a generating function like
\begin{align}
 \frac{4}{x-1} + \sum_{k=1}^\infty \frac{x^{k-1}(x^2\!+1)}{1-x^k}
 &= - 3 - 2x - x^2\! + x^3\! + 3x^5\! + 4x^7\! + x^8\! + 4x^{9}\! + x^{10}\! \\
  &\hspace{3em} + 6x^{11}\! + 6x^{13}\! + 2x^{14}\! + 5x^{15}\! + 2x^{16}\! + 7x^{17}\! + 8x^{19}\! + \cdots,
\end{align}
where the set of missing exponents, $\{4,6,12,18,30,42,\dots\}$, is the set of twin prime separators? Does that suit your needs?
A: It isn't even known that there is always a twin prime pair greater than $N$ (so strictly speaking, there isn't an algorithm that is known to work).  
A: I wouldn't be so quick to dismiss timidpueo's “algorithm” (although it could easily be made faster by replacing $N+1$ by $N+6$, among other tricks).  Conjecturally, the average spacing between twin primes is $O(\log^2 N)$ and the worst-case spacing is $O(\log^3 N)$.  So in practice, this is a polynomial time “algorithm” (even though it is not guaranteed to terminate, hence the quotes).
A: There's a superfast method:
Don't look for primes! Look for one tiny class of semiprimes. The product of all twin primes is an even perfect square minus 1. And since we're searching for semiprimes, a primality test is not required. Any factor (prime or not) less than the square root of X^2 - 1 eliminates the composite as a candidate. Furthermore, these factors are usually trivial - that is, they're found long before X.
Demonstration: http://www.naturalnumbers.org/TwinPrimeCalc.xlsm
