[Math] Possible method to prove infinite twin prime conjecture

linear algebraprime numbersproof-verification

I have an idea looking more and more promising that may lead to proving the infinite twin prime conjecture. My idea would set up a correspondence between primes and twin prime pairs. Since primes have been proven infinite, twin primes would be shown infinite as well. Here it is:

For every prime $p>7$ there exists at least one unique twin prime pair $(p_t,p_t+2)$ created using only primes less than $p$ as follows:

$$(p_t,p_t+2)=(3\times5\times P_p\times p-4,\ \ 3\times 5\times p\times P_p-2)$$

or

$$(p_t,p_t+2)=(3\times5\times P_p\times p+2,\ \ 3\times5\times p\times P_p+4)$$

where $P_p$ is some product of individual primes ($p_n$) and their powers (although recent developments indicate powers may be unnecessary!) such that each fits the following condition:

$$5<p_n<p$$

Here's a few examples:

$(3\times5\times43-4,\ \ 3\times5\times43-2)=(641,643)$

$(3\times5\times7^2\times11\times47+2,\ \ 3\times5\times7^2\times11\times47+4)=(379997,379999)$

My request is for one of the following:

  1. Someone to refine our program for a brute force testing method trying to find a counter-example to disprove my conjecture. Here's the code:

Original Wolfram Notebook

NEW AND IMPROVED Wolfram Notebook

  1. Someone to develop a proof of my conjecture; perhaps something related to the fact that the multitude of combinations/permutations etc. of primes ($5<p_p<p$) and their powers requires that there be at least one twin prime pair created. Perhaps a proof by contradiction? I.e. $p$ exists such that no twin prime is created is proven absurd, thus each $p$ maps to a unique twin prime, and as primes are infinite, so are twin primes? Need some help here! Maybe someone with rep to spare set a bounty?

EDIT (2/15/16)
Thanks to @dbanet, I now have code needing some refinements. Still, what's astonishing is that we've checked the first $10,000$ primes and each has its own unique twin prime pair… and it didn't even require powers of primes; everything is to the 1st power! This fact alone should lend high credence to the conjecture that each prime may be mapped to (at least one) unique twin prime pair. I'm considering perhaps removing powers of primes from the original question.

Here's the list up to 109 for verification. You can check each by adding $4$ or subtracting $2$ from the first in the pair and looking at the prime factors. All will include $3$, $5$ , $p$, and primes between $5$ and $p$ all to the $1$st power (prime#, prime, twin prime):


4, 7, {101},{103}
5, 11, {1151},{1153}
6, 13, {191},{193}
7, 17, {4337},{4339}
8, 19, {281},{283}
9, 23, {347},{349}
10, 29, {431},{433}
11, 31, {461},{463}
12, 37, {17207},{17209}
13, 41, {617},{619}
14, 43, {641},{643}
15, 47, {1225997},{1225999}
16, 53, {37361},{37363}
17, 59, {881},{883}
18, 61, {55817},{55819}
19, 67, {3616997},{3616999}
20, 71, {1061},{1063}
21, 73, {1091},{1093}
22, 79, {6141857},{6141859}
23, 83, {5922461},{5922463}
24, 89, {546625097},{546625099}
25, 97, {1451},{1453}
26, 101, {134837},{134839}
27, 103, {13888001},{13888003}
28, 107, {1607},{1609}
29, 109, {16969661},{16969663}

EDIT (2/15/16)PM
Got a new list of twin primes because of https://mathematica.stackexchange.com/questions/107417/memory-limit-hit-optimize-code-for-finding-twin-primes .

Here's the list of primes $2000-10000$ with the corresponding twin prime pairs!
https://dl.dropboxusercontent.com/u/76769933/8000%20twin%20primes.txt

And just for kicks here's the $100,000,000$th prime with the first found (probably not only) twin prime unique to it: $2038074743$ — $(126984732620985857058143952617,$ $126984732620985857058143952619)$

Best Answer

Wolfram Language code to test whether does $p$ provide the twin prime number pair via your conjecture or not is as follows.

twinPrimesQ[tp_]:=tp[[1]]+2==tp[[2]]&&PrimeQ[tp[[1]]]&&PrimeQ[tp[[2]]];
primesList[p_]:=Module[{out={Prime[3]},i},
    For[i=4,Prime[i]<=p,i=i+1,
        out=Append[out,Prime[i]];
    ];
    out
];
testPrime[p_,pl_]:=Module[{out,found=False,twinPrimes,primeFactors,primeFactorsPowers,i},
    twinPrimes={
        {3 5 prod p-4,3 5 prod p-2},
        {3 5 prod p+2,3 5 prod p+4}
    };
    primeFactors=primesList[p];
    primeFactorsPowers=Tuples[Range[0,pl],primeFactors//Length];
    For[i=1,i<=Length[primeFactorsPowers],i=i+1,
        out=twinPrimes/.prod->Product[primeFactors[[k]]^primeFactorsPowers[[i]][[k]],{k,1,primeFactors//Length}];
        found=twinPrimesQ[out[[1]]]||twinPrimesQ[out[[2]]];
        If[found,Break[]];
    ];
    If[found,out~Select~(twinPrimesQ[#]&)//First,False]
];

This defines a function twinPrime[p,pl] where p=$\,p$ and pl is the maximum power of prime factors of $P_p$ to search upon. The function returns the first found twin pair or False if it has failed.

For example:

usage example

You can try this online with Mathics.

To confirm or disprove your conjecture for ranges of primes, you can use

out=List[]; For[i=4,i<=7,i=i+1,out=out~Append~{i,Prime[i],testPrime[Prime[i],1]}]; out//TableForm

adjusting the bounds of search (values of j in terms of consecutive number of primes) and maximum power of prime factors. This will output a table with three columns: the id of the prime being tested, the prime itself and the first twin prime pair found (or False if none).