Twin primes whose sum is a cube [closed] Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)$84537841287167$ and $84537841287169$ a particular pair of twin primes!Conjecture on twin primesAbout a paper by Gold & Tucker (characterizing twin primes)Twin Primes Problem: Need HelpNumber Theory : Primes not in Twin PrimesIs there more than one occurrence of a power of two between twin primes?Twin Primes, their Arithmetic Means and some properties.Twin Primes and Complete Residue SystemsWhat is wrong with this reasoning regarding twin primes?A sieve for twin primes; does it imply there are infinite many twin primes?A twin prime theorem, and a reformulation of the twin prime conjecture

What LEGO pieces have "real-world" functionality?

What would be Julian Assange's expected punishment, on the current English criminal law?

Who can trigger ship-wide alerts in Star Trek?

Writing Thesis: Copying from published papers

Choo-choo! Word trains

Classification of bundles, Postnikov towers, obstruction theory, local coefficients

Problem when applying foreach loop

Fishing simulator

Cauchy Sequence Characterized only By Directly Neighbouring Sequence Members

Passing functions in C++

Using "nakedly" instead of "with nothing on"

Can smartphones with the same camera sensor have different image quality?

What's the point in a preamp?

How does modal jazz use chord progressions?

Direct Experience of Meditation

Complexity of many constant time steps with occasional logarithmic steps

What do you call the holes in a flute?

Why does this iterative way of solving of equation work?

Stopping real property loss from eroding embankment

How do I keep my slimes from escaping their pens?

What do I do if technical issues prevent me from filing my return on time?

Determine whether f is a function, an injection, a surjection

Estimate capacitor parameters

Why is there no army of Iron-Mans in the MCU?



Twin primes whose sum is a cube [closed]



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)$84537841287167$ and $84537841287169$ a particular pair of twin primes!Conjecture on twin primesAbout a paper by Gold & Tucker (characterizing twin primes)Twin Primes Problem: Need HelpNumber Theory : Primes not in Twin PrimesIs there more than one occurrence of a power of two between twin primes?Twin Primes, their Arithmetic Means and some properties.Twin Primes and Complete Residue SystemsWhat is wrong with this reasoning regarding twin primes?A sieve for twin primes; does it imply there are infinite many twin primes?A twin prime theorem, and a reformulation of the twin prime conjecture










6












$begingroup$


$84537841287167$ and $84537841287169$ are a pair of twin primes.



The sum of $84537841287167+84537841287169$ is a cube.



Are there other examples of twin pairs $p$, $p+2$ whose sum is a cube?



Have they to have a particular form?










share|cite|improve this question











$endgroup$



closed as off-topic by user21820, Adrian Keister, Saad, José Carlos Santos, YiFan Apr 5 at 23:39


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – user21820, Adrian Keister, Saad, José Carlos Santos, YiFan
If this question can be reworded to fit the rules in the help center, please edit the question.











  • 2




    $begingroup$
    What do you want to do with other examples?
    $endgroup$
    – Dietrich Burde
    Apr 4 at 9:50






  • 6




    $begingroup$
    For $k le 10000$, there are $185$ values of $k$ where $p = 108k^3-1$ and $p+2$ are twin primes that sum to a cube. Following are some examples.. $107,2634011,29659499,57395627,104792291,271669247,485149499,cdots\ 83797007573051, colorred84537841287167, 88875400155587,89731703685707,89846291353499,cdots$
    $endgroup$
    – achille hui
    Apr 4 at 10:23






  • 1




    $begingroup$
    @taritgoswami it is a single line command using the CAS maxima for k : 1 thru 10000 do if (primep(108*k^3-1) and primep(108*k^3+1)) then print(k," ",108*k^3-1);
    $endgroup$
    – achille hui
    Apr 4 at 12:10






  • 3




    $begingroup$
    oeis.org/A061308 is worth a look.
    $endgroup$
    – Barry Cipra
    Apr 4 at 12:15






  • 2




    $begingroup$
    similarly oeis.org/A240169
    $endgroup$
    – KBusc
    Apr 4 at 16:00















6












$begingroup$


$84537841287167$ and $84537841287169$ are a pair of twin primes.



The sum of $84537841287167+84537841287169$ is a cube.



Are there other examples of twin pairs $p$, $p+2$ whose sum is a cube?



Have they to have a particular form?










share|cite|improve this question











$endgroup$



closed as off-topic by user21820, Adrian Keister, Saad, José Carlos Santos, YiFan Apr 5 at 23:39


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – user21820, Adrian Keister, Saad, José Carlos Santos, YiFan
If this question can be reworded to fit the rules in the help center, please edit the question.











  • 2




    $begingroup$
    What do you want to do with other examples?
    $endgroup$
    – Dietrich Burde
    Apr 4 at 9:50






  • 6




    $begingroup$
    For $k le 10000$, there are $185$ values of $k$ where $p = 108k^3-1$ and $p+2$ are twin primes that sum to a cube. Following are some examples.. $107,2634011,29659499,57395627,104792291,271669247,485149499,cdots\ 83797007573051, colorred84537841287167, 88875400155587,89731703685707,89846291353499,cdots$
    $endgroup$
    – achille hui
    Apr 4 at 10:23






  • 1




    $begingroup$
    @taritgoswami it is a single line command using the CAS maxima for k : 1 thru 10000 do if (primep(108*k^3-1) and primep(108*k^3+1)) then print(k," ",108*k^3-1);
    $endgroup$
    – achille hui
    Apr 4 at 12:10






  • 3




    $begingroup$
    oeis.org/A061308 is worth a look.
    $endgroup$
    – Barry Cipra
    Apr 4 at 12:15






  • 2




    $begingroup$
    similarly oeis.org/A240169
    $endgroup$
    – KBusc
    Apr 4 at 16:00













6












6








6


2



$begingroup$


$84537841287167$ and $84537841287169$ are a pair of twin primes.



The sum of $84537841287167+84537841287169$ is a cube.



Are there other examples of twin pairs $p$, $p+2$ whose sum is a cube?



Have they to have a particular form?










share|cite|improve this question











$endgroup$




$84537841287167$ and $84537841287169$ are a pair of twin primes.



The sum of $84537841287167+84537841287169$ is a cube.



Are there other examples of twin pairs $p$, $p+2$ whose sum is a cube?



Have they to have a particular form?







elementary-number-theory






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Apr 4 at 10:11









tarit goswami

2,2361422




2,2361422










asked Apr 4 at 9:29







user660792











closed as off-topic by user21820, Adrian Keister, Saad, José Carlos Santos, YiFan Apr 5 at 23:39


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – user21820, Adrian Keister, Saad, José Carlos Santos, YiFan
If this question can be reworded to fit the rules in the help center, please edit the question.







closed as off-topic by user21820, Adrian Keister, Saad, José Carlos Santos, YiFan Apr 5 at 23:39


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – user21820, Adrian Keister, Saad, José Carlos Santos, YiFan
If this question can be reworded to fit the rules in the help center, please edit the question.







  • 2




    $begingroup$
    What do you want to do with other examples?
    $endgroup$
    – Dietrich Burde
    Apr 4 at 9:50






  • 6




    $begingroup$
    For $k le 10000$, there are $185$ values of $k$ where $p = 108k^3-1$ and $p+2$ are twin primes that sum to a cube. Following are some examples.. $107,2634011,29659499,57395627,104792291,271669247,485149499,cdots\ 83797007573051, colorred84537841287167, 88875400155587,89731703685707,89846291353499,cdots$
    $endgroup$
    – achille hui
    Apr 4 at 10:23






  • 1




    $begingroup$
    @taritgoswami it is a single line command using the CAS maxima for k : 1 thru 10000 do if (primep(108*k^3-1) and primep(108*k^3+1)) then print(k," ",108*k^3-1);
    $endgroup$
    – achille hui
    Apr 4 at 12:10






  • 3




    $begingroup$
    oeis.org/A061308 is worth a look.
    $endgroup$
    – Barry Cipra
    Apr 4 at 12:15






  • 2




    $begingroup$
    similarly oeis.org/A240169
    $endgroup$
    – KBusc
    Apr 4 at 16:00












  • 2




    $begingroup$
    What do you want to do with other examples?
    $endgroup$
    – Dietrich Burde
    Apr 4 at 9:50






  • 6




    $begingroup$
    For $k le 10000$, there are $185$ values of $k$ where $p = 108k^3-1$ and $p+2$ are twin primes that sum to a cube. Following are some examples.. $107,2634011,29659499,57395627,104792291,271669247,485149499,cdots\ 83797007573051, colorred84537841287167, 88875400155587,89731703685707,89846291353499,cdots$
    $endgroup$
    – achille hui
    Apr 4 at 10:23






  • 1




    $begingroup$
    @taritgoswami it is a single line command using the CAS maxima for k : 1 thru 10000 do if (primep(108*k^3-1) and primep(108*k^3+1)) then print(k," ",108*k^3-1);
    $endgroup$
    – achille hui
    Apr 4 at 12:10






  • 3




    $begingroup$
    oeis.org/A061308 is worth a look.
    $endgroup$
    – Barry Cipra
    Apr 4 at 12:15






  • 2




    $begingroup$
    similarly oeis.org/A240169
    $endgroup$
    – KBusc
    Apr 4 at 16:00







2




2




$begingroup$
What do you want to do with other examples?
$endgroup$
– Dietrich Burde
Apr 4 at 9:50




$begingroup$
What do you want to do with other examples?
$endgroup$
– Dietrich Burde
Apr 4 at 9:50




6




6




$begingroup$
For $k le 10000$, there are $185$ values of $k$ where $p = 108k^3-1$ and $p+2$ are twin primes that sum to a cube. Following are some examples.. $107,2634011,29659499,57395627,104792291,271669247,485149499,cdots\ 83797007573051, colorred84537841287167, 88875400155587,89731703685707,89846291353499,cdots$
$endgroup$
– achille hui
Apr 4 at 10:23




$begingroup$
For $k le 10000$, there are $185$ values of $k$ where $p = 108k^3-1$ and $p+2$ are twin primes that sum to a cube. Following are some examples.. $107,2634011,29659499,57395627,104792291,271669247,485149499,cdots\ 83797007573051, colorred84537841287167, 88875400155587,89731703685707,89846291353499,cdots$
$endgroup$
– achille hui
Apr 4 at 10:23




1




1




$begingroup$
@taritgoswami it is a single line command using the CAS maxima for k : 1 thru 10000 do if (primep(108*k^3-1) and primep(108*k^3+1)) then print(k," ",108*k^3-1);
$endgroup$
– achille hui
Apr 4 at 12:10




$begingroup$
@taritgoswami it is a single line command using the CAS maxima for k : 1 thru 10000 do if (primep(108*k^3-1) and primep(108*k^3+1)) then print(k," ",108*k^3-1);
$endgroup$
– achille hui
Apr 4 at 12:10




3




3




$begingroup$
oeis.org/A061308 is worth a look.
$endgroup$
– Barry Cipra
Apr 4 at 12:15




$begingroup$
oeis.org/A061308 is worth a look.
$endgroup$
– Barry Cipra
Apr 4 at 12:15




2




2




$begingroup$
similarly oeis.org/A240169
$endgroup$
– KBusc
Apr 4 at 16:00




$begingroup$
similarly oeis.org/A240169
$endgroup$
– KBusc
Apr 4 at 16:00










5 Answers
5






active

oldest

votes


















21












$begingroup$

List of Some Twin Primes Greater than $bf3$ whose Sum is a Cube



The sum of twin primes $6k-1$ and $6k+1$ is $12k$ and $12k=j^3implies6mid j$. So to look for such twin primes, look for twin primes of the form
$$
(108n^3-1,108n^3+1)
$$

We can skip $nequiv2pmod5$ since
$$
beginalign
108cdot n^3+1
&equiv3cdot2^3+1&pmod5\
&equiv0&pmod5
endalign
$$

and we can skip $nequiv3pmod5$ since
$$
beginalign
108cdot n^3-1
&equiv3cdot3^3-1&pmod5\
&equiv0&pmod5
endalign
$$

Checking $nequiv0,1,4pmod5$, we get
$$
beginarrayl
n&108n^3-1&108n^3+1\hline
1&107&109\
29&2634011&2634013\
65&29659499&29659501\
81&57395627&57395629\
99&104792291&104792293\
136&271669247&271669249\
165&485149499&485149501\
174&568946591&568946593\
176&588791807&588791809\
191&752530067&752530069\
200&863999999&864000001\
266&2032678367&2032678369\
295&2772616499&2772616501\
301&2945257307&2945257309\
319&3505869971&3505869973\
346&4473547487&4473547489\
351&4670303507&4670303509\
370&5470523999&5470524001\
400&6911999999&6912000001\
411&7498065347&7498065349\
431&8646803027&8646803029\
434&8828622431&8828622433\
436&8951240447&8951240449\
456&10240432127&10240432129\
491&12784043267&12784043269\
494&13019808671&13019808673\
526&15717410207&15717410209\
541&17100765467&17100765469\
599&23211554291&23211554293\
651&29796600707&29796600709\
676&33362903807&33362903809\
714&39311389151&39311389153\
746&44837381087&44837381089\
790&53248211999&53248212001\
924&85200014591&85200014593\
956&94362064127&94362064129\
991&105110165267&105110165269\
endarray
$$

Note that the sum of the primes is $(6n)^3$.



This list does not include $3+5=2^3$ because $(3,5)$ is the only twin prime that is not of the form $(6k-1,6k+1)$; that is, all primes greater than $3$ must be relatively prime to $6$.




Mathematica Code



Module[s = "", m, 
For[n = 1, n < 1000, ++n,
If[MemberQ[0, 1, 4, Mod[n, 5]] && PrimeQ[(m = 108 n^3) - 1] &&
PrimeQ[m + 1],
s = StringJoin[s,
ToString[n] <> "&" <> ToString[m - 1] <> "&" <> ToString[m + 1] <>
"\n"]]]; s]





share|cite|improve this answer











$endgroup$








  • 1




    $begingroup$
    "We can immediately skip $nequiv2,3pmod5$ since $5mid108cdot2^3+1$ and $5mid108cdot3^3-1$" I don't understand this line, could you explain this a little further?
    $endgroup$
    – spyr03
    Apr 4 at 15:46






  • 3




    $begingroup$
    As $5$ divides $108cdot 2^3+1$, for any $k$ of the form $5t+2$ we have $108cdot (5t+2)^3+ 1$. Now using binomial expansion you can see that it will left $5cdot m+108cdot 2^3$, which is divisible by $5$. Hence it can't be prime. So we are not checking for that $n$. Same argument goes for $nequiv 3pmod5$.
    $endgroup$
    – OppoInfinity
    Apr 4 at 15:54










  • $begingroup$
    @spyr03: I have expanded the section about the values skipped
    $endgroup$
    – robjohn
    Apr 4 at 17:27



















13












$begingroup$

$3$ and $5$ add to $2^3$, and $107 + 109 = 6^3$. So yes, there are other examples.



Clearly the sum has to be even, so if you want to systematically look for examples, then you could look through numbers of the form
$$
frac(2n)^32pm 1
$$

and check whether they are twin primes. That's how I found the $6^3$ one, at least. I'm sure there are clever ways to cut down the search space further. Or maybe it's better to look through all twin primes and see whether they add to cubes. I have no idea which would actually be faster.




Edit Apart from $3+5$, the primes cannot be divisible by $3$ (obviously), and since neither $p$ nor $p+2$ are divisible by $3$, that means their sum is divisible by $3$. So instead of just $frac(2n)^32pm1$, you can narrow it to $frac(6n)^32pm 1$.



Once can do a similar analysis on the basis of, say, $5$, and find that $nnotequiv 2, 3pmod 5$, meaning the numerator must be on one of the forms $(30n)^3, (30n + 6)^3$ or $(30n + 24)^3$.




New edit:



I used my above idea to search with the following Python program:



import math 

def is_prime(n):
if(n%2==0):
return False
for i in range(3,int(math.sqrt(n))+1,2):
if(n%i==0):
return False
return True

for i in range(1,300):
for k in [30*i, 30*i + 6, 30*i + 24]:
if is_prime(k**3/2 - 1) & is_prime(k**3/2 + 1):
print "%d & %d & %d\\" % (k**3/2 - 1, k**3/2 + 1, k)


(The speed of the program starts to go down at about 300.)



It found the following list:
$$
beginarray
hline
p&p+2&sqrt[3]textsum\
hline
2634011 & 2634013 & 174\
29659499 & 29659501 & 390\
57395627 & 57395629 & 486\
104792291 & 104792293 & 594\
271669247 & 271669249 & 816\
485149499 & 485149501 & 990\
568946591 & 568946593 & 1044\
588791807 & 588791809 & 1056\
752530067 & 752530069 & 1146\
863999999 & 864000001 & 1200\
2032678367 & 2032678369 & 1596\
2772616499 & 2772616501 & 1770\
2945257307 & 2945257309 & 1806\
3505869971 & 3505869973 & 1914\
4473547487 & 4473547489 & 2076\
4670303507 & 4670303509 & 2106\
5470523999 & 5470524001 & 2220\
6911999999 & 6912000001 & 2400\
7498065347 & 7498065349 & 2466\
8646803027 & 8646803029 & 2586\
8828622431 & 8828622433 & 2604\
8951240447 & 8951240449 & 2616\
10240432127 & 10240432129 & 2736\
12784043267 & 12784043269 & 2946\
13019808671 & 13019808673 & 2964\
15717410207 & 15717410209 & 3156\
17100765467 & 17100765469 & 3246\
23211554291 & 23211554293 & 3594\
29796600707 & 29796600709 & 3906\
33362903807 & 33362903809 & 4056\
39311389151 & 39311389153 & 4284\
44837381087 & 44837381089 & 4476\
53248211999 & 53248212001 & 4740\
85200014591 & 85200014593 & 5544\
94362064127 & 94362064129 & 5736\
105110165267 & 105110165269 & 5946\
111603347747 & 111603347749 & 6066\
156246957827 & 156246957829 & 6786\
169013118347 & 169013118349 & 6966\
183838613471 & 183838613473 & 7164\
215526633731 & 215526633733 & 7554\
223322272991 & 223322272993 & 7644\
226492415999 & 226492416001 & 7680\
239472986111 & 239472986113 & 7824\
280145695391 & 280145695393 & 8244\
hline
endarray
$$

This skips $2^3 = 3+5$ and $6^3 = 107+109$, and $24^3 = 6911 + 6913$ (although $6913 = 31cdot 223$, so that's irrelevant), because of some hiccup with the range in the primality test that I didn't bother fixing. Thanks to @taritgoswami for the prime test I copy-pasted from him and trimmed down a little. It still thinks $2$ is non-prime, but that's OK in this case. In fact, I could theoretically have taken away the whole parity check there, since I know I'm only feeding it odd numbers.



The print statement is formatted like that so that I could copy-paste it directly from the Python output into a MathJaX array without having to manually type all the formatting necessary.






share|cite|improve this answer











$endgroup$












  • $begingroup$
    some bigger one
    $endgroup$
    – user660792
    Apr 4 at 9:32










  • $begingroup$
    @DietrichBurde It's a cube, see the question body.
    $endgroup$
    – Arthur
    Apr 4 at 9:34










  • $begingroup$
    @DietrichBurde I'm sure we can. $17+19 = 6^2$, so $6$ is really prolific here.
    $endgroup$
    – Arthur
    Apr 4 at 9:37






  • 1




    $begingroup$
    with Maple can you find other examples?
    $endgroup$
    – user660792
    Apr 4 at 9:41










  • $begingroup$
    @pantareis I'm sure I could. If I knew how to use Maple. Or you could do it: I've already told you one possible algorithm.
    $endgroup$
    – Arthur
    Apr 4 at 9:42



















5












$begingroup$

To demonstrate that there are also huge solutions :



Define $$k=10^100+303593$$ $$s=4k^3-1$$ $$t=4k^3+1$$ then $(s,t)$ is a twin prime pair of the desired form which can be searched with this PARI/GP - routine



? z=prod(j=1,3*10^4,prime(j));k=10^100-1;gef=0;while(gef==0,k=k+1;s=4*k^3-1;t=4*
k^3+1;if(gcd(s*t,z)==1,if(ispseudoprime(s)==1,print(k-10^100);if(ispseudoprime(t)
==1,gef=1))))


$ s $and $ t $ are proven primes with $ 301 $ digits. Assuming the generalized bunyakovsky conjecture, there are infinite many pairs of the desired form.






share|cite|improve this answer









$endgroup$




















    4












    $begingroup$

    $(3,5),(107,109)$ and $(2634011,2634013)$ are only such twin prime pairs below $10^7$. You can check for more by increasing the range using this small Python code below. I just run it upto $10^8$, $(29659499,29659501)$ and $(57395627,57395629)$ are only such pairs with $10^7<p<10^8$.




    Edit:
    For optimization purpose, I will use the fact that all primes more than $3$ can be represented in the form $6kpm 1$.



    First let check manually for $p=2,3$. For $p=2$ it's clearly not possible. For $p=3$, we have $3+5=8=2^3$, so, $(3,5)$ is such pair.



    Suppose, $p=6k-1$, with $p>5$, then we have $12k=n^3$. That means, $12|n^3$. But, as $n^3$ is a perfect cube, and we have $12=3cdot 2^2$, at least $3^3cdot 2^3=216$ will divide $n^3$. So, the pair $(108m^3-1,108m^3+1)$ will be such pair if both of them are prime.



    While dealing with cubes, usually prefer to work in $mathbbZ_7$, as any cube is either of $0,1,6$ in this field,i.e; $n^3equiv 0,1,6pmod7$ . So, we can have $2p+2equiv 0pmod7$, which gives $pequiv 6pmod7$, or, $2p+2equiv 1pmod7$ which implies $pequiv 3pmod7$ or $2p+2equiv 6pmod7$ which implies $pequiv 2pmod7$. Hence, only $3$ pssibilities. Here is the updated program:



    import math
    import time

    start_time=time.time()
    def is_prime(n):
    flag=0
    if(n==2):
    return True
    if(n%2==0):
    return False
    else:
    for i in range(3,int(math.sqrt(n))+1,2):
    if(n%i==0):
    flag=1
    break
    if(flag==0):
    return True
    return False

    for i in range(1,1000):#change the number inside this braket to check for larger numbers
    c=(6*i)**3
    p=c//2-1
    if(p%7==2 or p%7==4 or p%7==6):
    if(is_prime(p) & is_prime(p+2)):
    print(p, "is such twin prime with sum",c)

    print(time.time()-start_time)





    share|cite|improve this answer











    $endgroup$












    • $begingroup$
      I am not the downvoter, but my guess is that it is because your script, the substance of your answer, is quite inefficient compared to some others that were posted.
      $endgroup$
      – Mees de Vries
      Apr 4 at 14:32










    • $begingroup$
      @MeesdeVries Updated it, please have a look.
      $endgroup$
      – tarit goswami
      Apr 4 at 19:20


















    1












    $begingroup$

    $p + (p + 2) = 2p + 2 = 2(p + 1)$



    For the sum to be a cube, $p + 1$ must be divisible by 4, so that the sum becomes $2 times 4m^3$ for some integer $m$. So $p + 1$ is of the form $4m^3$.






    share|cite|improve this answer









    $endgroup$








    • 2




      $begingroup$
      Also, with the exception of the twin prime pair 3,5, every pair of twin primes must be of the form 6n-1,6n+1. Using your notation, you can further refine based on this to $p+1=108k^3$
      $endgroup$
      – Moko19
      Apr 4 at 9:52
















    5 Answers
    5






    active

    oldest

    votes








    5 Answers
    5






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    21












    $begingroup$

    List of Some Twin Primes Greater than $bf3$ whose Sum is a Cube



    The sum of twin primes $6k-1$ and $6k+1$ is $12k$ and $12k=j^3implies6mid j$. So to look for such twin primes, look for twin primes of the form
    $$
    (108n^3-1,108n^3+1)
    $$

    We can skip $nequiv2pmod5$ since
    $$
    beginalign
    108cdot n^3+1
    &equiv3cdot2^3+1&pmod5\
    &equiv0&pmod5
    endalign
    $$

    and we can skip $nequiv3pmod5$ since
    $$
    beginalign
    108cdot n^3-1
    &equiv3cdot3^3-1&pmod5\
    &equiv0&pmod5
    endalign
    $$

    Checking $nequiv0,1,4pmod5$, we get
    $$
    beginarrayl
    n&108n^3-1&108n^3+1\hline
    1&107&109\
    29&2634011&2634013\
    65&29659499&29659501\
    81&57395627&57395629\
    99&104792291&104792293\
    136&271669247&271669249\
    165&485149499&485149501\
    174&568946591&568946593\
    176&588791807&588791809\
    191&752530067&752530069\
    200&863999999&864000001\
    266&2032678367&2032678369\
    295&2772616499&2772616501\
    301&2945257307&2945257309\
    319&3505869971&3505869973\
    346&4473547487&4473547489\
    351&4670303507&4670303509\
    370&5470523999&5470524001\
    400&6911999999&6912000001\
    411&7498065347&7498065349\
    431&8646803027&8646803029\
    434&8828622431&8828622433\
    436&8951240447&8951240449\
    456&10240432127&10240432129\
    491&12784043267&12784043269\
    494&13019808671&13019808673\
    526&15717410207&15717410209\
    541&17100765467&17100765469\
    599&23211554291&23211554293\
    651&29796600707&29796600709\
    676&33362903807&33362903809\
    714&39311389151&39311389153\
    746&44837381087&44837381089\
    790&53248211999&53248212001\
    924&85200014591&85200014593\
    956&94362064127&94362064129\
    991&105110165267&105110165269\
    endarray
    $$

    Note that the sum of the primes is $(6n)^3$.



    This list does not include $3+5=2^3$ because $(3,5)$ is the only twin prime that is not of the form $(6k-1,6k+1)$; that is, all primes greater than $3$ must be relatively prime to $6$.




    Mathematica Code



    Module[s = "", m, 
    For[n = 1, n < 1000, ++n,
    If[MemberQ[0, 1, 4, Mod[n, 5]] && PrimeQ[(m = 108 n^3) - 1] &&
    PrimeQ[m + 1],
    s = StringJoin[s,
    ToString[n] <> "&" <> ToString[m - 1] <> "&" <> ToString[m + 1] <>
    "\n"]]]; s]





    share|cite|improve this answer











    $endgroup$








    • 1




      $begingroup$
      "We can immediately skip $nequiv2,3pmod5$ since $5mid108cdot2^3+1$ and $5mid108cdot3^3-1$" I don't understand this line, could you explain this a little further?
      $endgroup$
      – spyr03
      Apr 4 at 15:46






    • 3




      $begingroup$
      As $5$ divides $108cdot 2^3+1$, for any $k$ of the form $5t+2$ we have $108cdot (5t+2)^3+ 1$. Now using binomial expansion you can see that it will left $5cdot m+108cdot 2^3$, which is divisible by $5$. Hence it can't be prime. So we are not checking for that $n$. Same argument goes for $nequiv 3pmod5$.
      $endgroup$
      – OppoInfinity
      Apr 4 at 15:54










    • $begingroup$
      @spyr03: I have expanded the section about the values skipped
      $endgroup$
      – robjohn
      Apr 4 at 17:27
















    21












    $begingroup$

    List of Some Twin Primes Greater than $bf3$ whose Sum is a Cube



    The sum of twin primes $6k-1$ and $6k+1$ is $12k$ and $12k=j^3implies6mid j$. So to look for such twin primes, look for twin primes of the form
    $$
    (108n^3-1,108n^3+1)
    $$

    We can skip $nequiv2pmod5$ since
    $$
    beginalign
    108cdot n^3+1
    &equiv3cdot2^3+1&pmod5\
    &equiv0&pmod5
    endalign
    $$

    and we can skip $nequiv3pmod5$ since
    $$
    beginalign
    108cdot n^3-1
    &equiv3cdot3^3-1&pmod5\
    &equiv0&pmod5
    endalign
    $$

    Checking $nequiv0,1,4pmod5$, we get
    $$
    beginarrayl
    n&108n^3-1&108n^3+1\hline
    1&107&109\
    29&2634011&2634013\
    65&29659499&29659501\
    81&57395627&57395629\
    99&104792291&104792293\
    136&271669247&271669249\
    165&485149499&485149501\
    174&568946591&568946593\
    176&588791807&588791809\
    191&752530067&752530069\
    200&863999999&864000001\
    266&2032678367&2032678369\
    295&2772616499&2772616501\
    301&2945257307&2945257309\
    319&3505869971&3505869973\
    346&4473547487&4473547489\
    351&4670303507&4670303509\
    370&5470523999&5470524001\
    400&6911999999&6912000001\
    411&7498065347&7498065349\
    431&8646803027&8646803029\
    434&8828622431&8828622433\
    436&8951240447&8951240449\
    456&10240432127&10240432129\
    491&12784043267&12784043269\
    494&13019808671&13019808673\
    526&15717410207&15717410209\
    541&17100765467&17100765469\
    599&23211554291&23211554293\
    651&29796600707&29796600709\
    676&33362903807&33362903809\
    714&39311389151&39311389153\
    746&44837381087&44837381089\
    790&53248211999&53248212001\
    924&85200014591&85200014593\
    956&94362064127&94362064129\
    991&105110165267&105110165269\
    endarray
    $$

    Note that the sum of the primes is $(6n)^3$.



    This list does not include $3+5=2^3$ because $(3,5)$ is the only twin prime that is not of the form $(6k-1,6k+1)$; that is, all primes greater than $3$ must be relatively prime to $6$.




    Mathematica Code



    Module[s = "", m, 
    For[n = 1, n < 1000, ++n,
    If[MemberQ[0, 1, 4, Mod[n, 5]] && PrimeQ[(m = 108 n^3) - 1] &&
    PrimeQ[m + 1],
    s = StringJoin[s,
    ToString[n] <> "&" <> ToString[m - 1] <> "&" <> ToString[m + 1] <>
    "\n"]]]; s]





    share|cite|improve this answer











    $endgroup$








    • 1




      $begingroup$
      "We can immediately skip $nequiv2,3pmod5$ since $5mid108cdot2^3+1$ and $5mid108cdot3^3-1$" I don't understand this line, could you explain this a little further?
      $endgroup$
      – spyr03
      Apr 4 at 15:46






    • 3




      $begingroup$
      As $5$ divides $108cdot 2^3+1$, for any $k$ of the form $5t+2$ we have $108cdot (5t+2)^3+ 1$. Now using binomial expansion you can see that it will left $5cdot m+108cdot 2^3$, which is divisible by $5$. Hence it can't be prime. So we are not checking for that $n$. Same argument goes for $nequiv 3pmod5$.
      $endgroup$
      – OppoInfinity
      Apr 4 at 15:54










    • $begingroup$
      @spyr03: I have expanded the section about the values skipped
      $endgroup$
      – robjohn
      Apr 4 at 17:27














    21












    21








    21





    $begingroup$

    List of Some Twin Primes Greater than $bf3$ whose Sum is a Cube



    The sum of twin primes $6k-1$ and $6k+1$ is $12k$ and $12k=j^3implies6mid j$. So to look for such twin primes, look for twin primes of the form
    $$
    (108n^3-1,108n^3+1)
    $$

    We can skip $nequiv2pmod5$ since
    $$
    beginalign
    108cdot n^3+1
    &equiv3cdot2^3+1&pmod5\
    &equiv0&pmod5
    endalign
    $$

    and we can skip $nequiv3pmod5$ since
    $$
    beginalign
    108cdot n^3-1
    &equiv3cdot3^3-1&pmod5\
    &equiv0&pmod5
    endalign
    $$

    Checking $nequiv0,1,4pmod5$, we get
    $$
    beginarrayl
    n&108n^3-1&108n^3+1\hline
    1&107&109\
    29&2634011&2634013\
    65&29659499&29659501\
    81&57395627&57395629\
    99&104792291&104792293\
    136&271669247&271669249\
    165&485149499&485149501\
    174&568946591&568946593\
    176&588791807&588791809\
    191&752530067&752530069\
    200&863999999&864000001\
    266&2032678367&2032678369\
    295&2772616499&2772616501\
    301&2945257307&2945257309\
    319&3505869971&3505869973\
    346&4473547487&4473547489\
    351&4670303507&4670303509\
    370&5470523999&5470524001\
    400&6911999999&6912000001\
    411&7498065347&7498065349\
    431&8646803027&8646803029\
    434&8828622431&8828622433\
    436&8951240447&8951240449\
    456&10240432127&10240432129\
    491&12784043267&12784043269\
    494&13019808671&13019808673\
    526&15717410207&15717410209\
    541&17100765467&17100765469\
    599&23211554291&23211554293\
    651&29796600707&29796600709\
    676&33362903807&33362903809\
    714&39311389151&39311389153\
    746&44837381087&44837381089\
    790&53248211999&53248212001\
    924&85200014591&85200014593\
    956&94362064127&94362064129\
    991&105110165267&105110165269\
    endarray
    $$

    Note that the sum of the primes is $(6n)^3$.



    This list does not include $3+5=2^3$ because $(3,5)$ is the only twin prime that is not of the form $(6k-1,6k+1)$; that is, all primes greater than $3$ must be relatively prime to $6$.




    Mathematica Code



    Module[s = "", m, 
    For[n = 1, n < 1000, ++n,
    If[MemberQ[0, 1, 4, Mod[n, 5]] && PrimeQ[(m = 108 n^3) - 1] &&
    PrimeQ[m + 1],
    s = StringJoin[s,
    ToString[n] <> "&" <> ToString[m - 1] <> "&" <> ToString[m + 1] <>
    "\n"]]]; s]





    share|cite|improve this answer











    $endgroup$



    List of Some Twin Primes Greater than $bf3$ whose Sum is a Cube



    The sum of twin primes $6k-1$ and $6k+1$ is $12k$ and $12k=j^3implies6mid j$. So to look for such twin primes, look for twin primes of the form
    $$
    (108n^3-1,108n^3+1)
    $$

    We can skip $nequiv2pmod5$ since
    $$
    beginalign
    108cdot n^3+1
    &equiv3cdot2^3+1&pmod5\
    &equiv0&pmod5
    endalign
    $$

    and we can skip $nequiv3pmod5$ since
    $$
    beginalign
    108cdot n^3-1
    &equiv3cdot3^3-1&pmod5\
    &equiv0&pmod5
    endalign
    $$

    Checking $nequiv0,1,4pmod5$, we get
    $$
    beginarrayl
    n&108n^3-1&108n^3+1\hline
    1&107&109\
    29&2634011&2634013\
    65&29659499&29659501\
    81&57395627&57395629\
    99&104792291&104792293\
    136&271669247&271669249\
    165&485149499&485149501\
    174&568946591&568946593\
    176&588791807&588791809\
    191&752530067&752530069\
    200&863999999&864000001\
    266&2032678367&2032678369\
    295&2772616499&2772616501\
    301&2945257307&2945257309\
    319&3505869971&3505869973\
    346&4473547487&4473547489\
    351&4670303507&4670303509\
    370&5470523999&5470524001\
    400&6911999999&6912000001\
    411&7498065347&7498065349\
    431&8646803027&8646803029\
    434&8828622431&8828622433\
    436&8951240447&8951240449\
    456&10240432127&10240432129\
    491&12784043267&12784043269\
    494&13019808671&13019808673\
    526&15717410207&15717410209\
    541&17100765467&17100765469\
    599&23211554291&23211554293\
    651&29796600707&29796600709\
    676&33362903807&33362903809\
    714&39311389151&39311389153\
    746&44837381087&44837381089\
    790&53248211999&53248212001\
    924&85200014591&85200014593\
    956&94362064127&94362064129\
    991&105110165267&105110165269\
    endarray
    $$

    Note that the sum of the primes is $(6n)^3$.



    This list does not include $3+5=2^3$ because $(3,5)$ is the only twin prime that is not of the form $(6k-1,6k+1)$; that is, all primes greater than $3$ must be relatively prime to $6$.




    Mathematica Code



    Module[s = "", m, 
    For[n = 1, n < 1000, ++n,
    If[MemberQ[0, 1, 4, Mod[n, 5]] && PrimeQ[(m = 108 n^3) - 1] &&
    PrimeQ[m + 1],
    s = StringJoin[s,
    ToString[n] <> "&" <> ToString[m - 1] <> "&" <> ToString[m + 1] <>
    "\n"]]]; s]






    share|cite|improve this answer














    share|cite|improve this answer



    share|cite|improve this answer








    edited Apr 5 at 9:45









    Community

    1




    1










    answered Apr 4 at 12:20









    robjohnrobjohn

    271k27315643




    271k27315643







    • 1




      $begingroup$
      "We can immediately skip $nequiv2,3pmod5$ since $5mid108cdot2^3+1$ and $5mid108cdot3^3-1$" I don't understand this line, could you explain this a little further?
      $endgroup$
      – spyr03
      Apr 4 at 15:46






    • 3




      $begingroup$
      As $5$ divides $108cdot 2^3+1$, for any $k$ of the form $5t+2$ we have $108cdot (5t+2)^3+ 1$. Now using binomial expansion you can see that it will left $5cdot m+108cdot 2^3$, which is divisible by $5$. Hence it can't be prime. So we are not checking for that $n$. Same argument goes for $nequiv 3pmod5$.
      $endgroup$
      – OppoInfinity
      Apr 4 at 15:54










    • $begingroup$
      @spyr03: I have expanded the section about the values skipped
      $endgroup$
      – robjohn
      Apr 4 at 17:27













    • 1




      $begingroup$
      "We can immediately skip $nequiv2,3pmod5$ since $5mid108cdot2^3+1$ and $5mid108cdot3^3-1$" I don't understand this line, could you explain this a little further?
      $endgroup$
      – spyr03
      Apr 4 at 15:46






    • 3




      $begingroup$
      As $5$ divides $108cdot 2^3+1$, for any $k$ of the form $5t+2$ we have $108cdot (5t+2)^3+ 1$. Now using binomial expansion you can see that it will left $5cdot m+108cdot 2^3$, which is divisible by $5$. Hence it can't be prime. So we are not checking for that $n$. Same argument goes for $nequiv 3pmod5$.
      $endgroup$
      – OppoInfinity
      Apr 4 at 15:54










    • $begingroup$
      @spyr03: I have expanded the section about the values skipped
      $endgroup$
      – robjohn
      Apr 4 at 17:27








    1




    1




    $begingroup$
    "We can immediately skip $nequiv2,3pmod5$ since $5mid108cdot2^3+1$ and $5mid108cdot3^3-1$" I don't understand this line, could you explain this a little further?
    $endgroup$
    – spyr03
    Apr 4 at 15:46




    $begingroup$
    "We can immediately skip $nequiv2,3pmod5$ since $5mid108cdot2^3+1$ and $5mid108cdot3^3-1$" I don't understand this line, could you explain this a little further?
    $endgroup$
    – spyr03
    Apr 4 at 15:46




    3




    3




    $begingroup$
    As $5$ divides $108cdot 2^3+1$, for any $k$ of the form $5t+2$ we have $108cdot (5t+2)^3+ 1$. Now using binomial expansion you can see that it will left $5cdot m+108cdot 2^3$, which is divisible by $5$. Hence it can't be prime. So we are not checking for that $n$. Same argument goes for $nequiv 3pmod5$.
    $endgroup$
    – OppoInfinity
    Apr 4 at 15:54




    $begingroup$
    As $5$ divides $108cdot 2^3+1$, for any $k$ of the form $5t+2$ we have $108cdot (5t+2)^3+ 1$. Now using binomial expansion you can see that it will left $5cdot m+108cdot 2^3$, which is divisible by $5$. Hence it can't be prime. So we are not checking for that $n$. Same argument goes for $nequiv 3pmod5$.
    $endgroup$
    – OppoInfinity
    Apr 4 at 15:54












    $begingroup$
    @spyr03: I have expanded the section about the values skipped
    $endgroup$
    – robjohn
    Apr 4 at 17:27





    $begingroup$
    @spyr03: I have expanded the section about the values skipped
    $endgroup$
    – robjohn
    Apr 4 at 17:27












    13












    $begingroup$

    $3$ and $5$ add to $2^3$, and $107 + 109 = 6^3$. So yes, there are other examples.



    Clearly the sum has to be even, so if you want to systematically look for examples, then you could look through numbers of the form
    $$
    frac(2n)^32pm 1
    $$

    and check whether they are twin primes. That's how I found the $6^3$ one, at least. I'm sure there are clever ways to cut down the search space further. Or maybe it's better to look through all twin primes and see whether they add to cubes. I have no idea which would actually be faster.




    Edit Apart from $3+5$, the primes cannot be divisible by $3$ (obviously), and since neither $p$ nor $p+2$ are divisible by $3$, that means their sum is divisible by $3$. So instead of just $frac(2n)^32pm1$, you can narrow it to $frac(6n)^32pm 1$.



    Once can do a similar analysis on the basis of, say, $5$, and find that $nnotequiv 2, 3pmod 5$, meaning the numerator must be on one of the forms $(30n)^3, (30n + 6)^3$ or $(30n + 24)^3$.




    New edit:



    I used my above idea to search with the following Python program:



    import math 

    def is_prime(n):
    if(n%2==0):
    return False
    for i in range(3,int(math.sqrt(n))+1,2):
    if(n%i==0):
    return False
    return True

    for i in range(1,300):
    for k in [30*i, 30*i + 6, 30*i + 24]:
    if is_prime(k**3/2 - 1) & is_prime(k**3/2 + 1):
    print "%d & %d & %d\\" % (k**3/2 - 1, k**3/2 + 1, k)


    (The speed of the program starts to go down at about 300.)



    It found the following list:
    $$
    beginarray
    hline
    p&p+2&sqrt[3]textsum\
    hline
    2634011 & 2634013 & 174\
    29659499 & 29659501 & 390\
    57395627 & 57395629 & 486\
    104792291 & 104792293 & 594\
    271669247 & 271669249 & 816\
    485149499 & 485149501 & 990\
    568946591 & 568946593 & 1044\
    588791807 & 588791809 & 1056\
    752530067 & 752530069 & 1146\
    863999999 & 864000001 & 1200\
    2032678367 & 2032678369 & 1596\
    2772616499 & 2772616501 & 1770\
    2945257307 & 2945257309 & 1806\
    3505869971 & 3505869973 & 1914\
    4473547487 & 4473547489 & 2076\
    4670303507 & 4670303509 & 2106\
    5470523999 & 5470524001 & 2220\
    6911999999 & 6912000001 & 2400\
    7498065347 & 7498065349 & 2466\
    8646803027 & 8646803029 & 2586\
    8828622431 & 8828622433 & 2604\
    8951240447 & 8951240449 & 2616\
    10240432127 & 10240432129 & 2736\
    12784043267 & 12784043269 & 2946\
    13019808671 & 13019808673 & 2964\
    15717410207 & 15717410209 & 3156\
    17100765467 & 17100765469 & 3246\
    23211554291 & 23211554293 & 3594\
    29796600707 & 29796600709 & 3906\
    33362903807 & 33362903809 & 4056\
    39311389151 & 39311389153 & 4284\
    44837381087 & 44837381089 & 4476\
    53248211999 & 53248212001 & 4740\
    85200014591 & 85200014593 & 5544\
    94362064127 & 94362064129 & 5736\
    105110165267 & 105110165269 & 5946\
    111603347747 & 111603347749 & 6066\
    156246957827 & 156246957829 & 6786\
    169013118347 & 169013118349 & 6966\
    183838613471 & 183838613473 & 7164\
    215526633731 & 215526633733 & 7554\
    223322272991 & 223322272993 & 7644\
    226492415999 & 226492416001 & 7680\
    239472986111 & 239472986113 & 7824\
    280145695391 & 280145695393 & 8244\
    hline
    endarray
    $$

    This skips $2^3 = 3+5$ and $6^3 = 107+109$, and $24^3 = 6911 + 6913$ (although $6913 = 31cdot 223$, so that's irrelevant), because of some hiccup with the range in the primality test that I didn't bother fixing. Thanks to @taritgoswami for the prime test I copy-pasted from him and trimmed down a little. It still thinks $2$ is non-prime, but that's OK in this case. In fact, I could theoretically have taken away the whole parity check there, since I know I'm only feeding it odd numbers.



    The print statement is formatted like that so that I could copy-paste it directly from the Python output into a MathJaX array without having to manually type all the formatting necessary.






    share|cite|improve this answer











    $endgroup$












    • $begingroup$
      some bigger one
      $endgroup$
      – user660792
      Apr 4 at 9:32










    • $begingroup$
      @DietrichBurde It's a cube, see the question body.
      $endgroup$
      – Arthur
      Apr 4 at 9:34










    • $begingroup$
      @DietrichBurde I'm sure we can. $17+19 = 6^2$, so $6$ is really prolific here.
      $endgroup$
      – Arthur
      Apr 4 at 9:37






    • 1




      $begingroup$
      with Maple can you find other examples?
      $endgroup$
      – user660792
      Apr 4 at 9:41










    • $begingroup$
      @pantareis I'm sure I could. If I knew how to use Maple. Or you could do it: I've already told you one possible algorithm.
      $endgroup$
      – Arthur
      Apr 4 at 9:42
















    13












    $begingroup$

    $3$ and $5$ add to $2^3$, and $107 + 109 = 6^3$. So yes, there are other examples.



    Clearly the sum has to be even, so if you want to systematically look for examples, then you could look through numbers of the form
    $$
    frac(2n)^32pm 1
    $$

    and check whether they are twin primes. That's how I found the $6^3$ one, at least. I'm sure there are clever ways to cut down the search space further. Or maybe it's better to look through all twin primes and see whether they add to cubes. I have no idea which would actually be faster.




    Edit Apart from $3+5$, the primes cannot be divisible by $3$ (obviously), and since neither $p$ nor $p+2$ are divisible by $3$, that means their sum is divisible by $3$. So instead of just $frac(2n)^32pm1$, you can narrow it to $frac(6n)^32pm 1$.



    Once can do a similar analysis on the basis of, say, $5$, and find that $nnotequiv 2, 3pmod 5$, meaning the numerator must be on one of the forms $(30n)^3, (30n + 6)^3$ or $(30n + 24)^3$.




    New edit:



    I used my above idea to search with the following Python program:



    import math 

    def is_prime(n):
    if(n%2==0):
    return False
    for i in range(3,int(math.sqrt(n))+1,2):
    if(n%i==0):
    return False
    return True

    for i in range(1,300):
    for k in [30*i, 30*i + 6, 30*i + 24]:
    if is_prime(k**3/2 - 1) & is_prime(k**3/2 + 1):
    print "%d & %d & %d\\" % (k**3/2 - 1, k**3/2 + 1, k)


    (The speed of the program starts to go down at about 300.)



    It found the following list:
    $$
    beginarray
    hline
    p&p+2&sqrt[3]textsum\
    hline
    2634011 & 2634013 & 174\
    29659499 & 29659501 & 390\
    57395627 & 57395629 & 486\
    104792291 & 104792293 & 594\
    271669247 & 271669249 & 816\
    485149499 & 485149501 & 990\
    568946591 & 568946593 & 1044\
    588791807 & 588791809 & 1056\
    752530067 & 752530069 & 1146\
    863999999 & 864000001 & 1200\
    2032678367 & 2032678369 & 1596\
    2772616499 & 2772616501 & 1770\
    2945257307 & 2945257309 & 1806\
    3505869971 & 3505869973 & 1914\
    4473547487 & 4473547489 & 2076\
    4670303507 & 4670303509 & 2106\
    5470523999 & 5470524001 & 2220\
    6911999999 & 6912000001 & 2400\
    7498065347 & 7498065349 & 2466\
    8646803027 & 8646803029 & 2586\
    8828622431 & 8828622433 & 2604\
    8951240447 & 8951240449 & 2616\
    10240432127 & 10240432129 & 2736\
    12784043267 & 12784043269 & 2946\
    13019808671 & 13019808673 & 2964\
    15717410207 & 15717410209 & 3156\
    17100765467 & 17100765469 & 3246\
    23211554291 & 23211554293 & 3594\
    29796600707 & 29796600709 & 3906\
    33362903807 & 33362903809 & 4056\
    39311389151 & 39311389153 & 4284\
    44837381087 & 44837381089 & 4476\
    53248211999 & 53248212001 & 4740\
    85200014591 & 85200014593 & 5544\
    94362064127 & 94362064129 & 5736\
    105110165267 & 105110165269 & 5946\
    111603347747 & 111603347749 & 6066\
    156246957827 & 156246957829 & 6786\
    169013118347 & 169013118349 & 6966\
    183838613471 & 183838613473 & 7164\
    215526633731 & 215526633733 & 7554\
    223322272991 & 223322272993 & 7644\
    226492415999 & 226492416001 & 7680\
    239472986111 & 239472986113 & 7824\
    280145695391 & 280145695393 & 8244\
    hline
    endarray
    $$

    This skips $2^3 = 3+5$ and $6^3 = 107+109$, and $24^3 = 6911 + 6913$ (although $6913 = 31cdot 223$, so that's irrelevant), because of some hiccup with the range in the primality test that I didn't bother fixing. Thanks to @taritgoswami for the prime test I copy-pasted from him and trimmed down a little. It still thinks $2$ is non-prime, but that's OK in this case. In fact, I could theoretically have taken away the whole parity check there, since I know I'm only feeding it odd numbers.



    The print statement is formatted like that so that I could copy-paste it directly from the Python output into a MathJaX array without having to manually type all the formatting necessary.






    share|cite|improve this answer











    $endgroup$












    • $begingroup$
      some bigger one
      $endgroup$
      – user660792
      Apr 4 at 9:32










    • $begingroup$
      @DietrichBurde It's a cube, see the question body.
      $endgroup$
      – Arthur
      Apr 4 at 9:34










    • $begingroup$
      @DietrichBurde I'm sure we can. $17+19 = 6^2$, so $6$ is really prolific here.
      $endgroup$
      – Arthur
      Apr 4 at 9:37






    • 1




      $begingroup$
      with Maple can you find other examples?
      $endgroup$
      – user660792
      Apr 4 at 9:41










    • $begingroup$
      @pantareis I'm sure I could. If I knew how to use Maple. Or you could do it: I've already told you one possible algorithm.
      $endgroup$
      – Arthur
      Apr 4 at 9:42














    13












    13








    13





    $begingroup$

    $3$ and $5$ add to $2^3$, and $107 + 109 = 6^3$. So yes, there are other examples.



    Clearly the sum has to be even, so if you want to systematically look for examples, then you could look through numbers of the form
    $$
    frac(2n)^32pm 1
    $$

    and check whether they are twin primes. That's how I found the $6^3$ one, at least. I'm sure there are clever ways to cut down the search space further. Or maybe it's better to look through all twin primes and see whether they add to cubes. I have no idea which would actually be faster.




    Edit Apart from $3+5$, the primes cannot be divisible by $3$ (obviously), and since neither $p$ nor $p+2$ are divisible by $3$, that means their sum is divisible by $3$. So instead of just $frac(2n)^32pm1$, you can narrow it to $frac(6n)^32pm 1$.



    Once can do a similar analysis on the basis of, say, $5$, and find that $nnotequiv 2, 3pmod 5$, meaning the numerator must be on one of the forms $(30n)^3, (30n + 6)^3$ or $(30n + 24)^3$.




    New edit:



    I used my above idea to search with the following Python program:



    import math 

    def is_prime(n):
    if(n%2==0):
    return False
    for i in range(3,int(math.sqrt(n))+1,2):
    if(n%i==0):
    return False
    return True

    for i in range(1,300):
    for k in [30*i, 30*i + 6, 30*i + 24]:
    if is_prime(k**3/2 - 1) & is_prime(k**3/2 + 1):
    print "%d & %d & %d\\" % (k**3/2 - 1, k**3/2 + 1, k)


    (The speed of the program starts to go down at about 300.)



    It found the following list:
    $$
    beginarray
    hline
    p&p+2&sqrt[3]textsum\
    hline
    2634011 & 2634013 & 174\
    29659499 & 29659501 & 390\
    57395627 & 57395629 & 486\
    104792291 & 104792293 & 594\
    271669247 & 271669249 & 816\
    485149499 & 485149501 & 990\
    568946591 & 568946593 & 1044\
    588791807 & 588791809 & 1056\
    752530067 & 752530069 & 1146\
    863999999 & 864000001 & 1200\
    2032678367 & 2032678369 & 1596\
    2772616499 & 2772616501 & 1770\
    2945257307 & 2945257309 & 1806\
    3505869971 & 3505869973 & 1914\
    4473547487 & 4473547489 & 2076\
    4670303507 & 4670303509 & 2106\
    5470523999 & 5470524001 & 2220\
    6911999999 & 6912000001 & 2400\
    7498065347 & 7498065349 & 2466\
    8646803027 & 8646803029 & 2586\
    8828622431 & 8828622433 & 2604\
    8951240447 & 8951240449 & 2616\
    10240432127 & 10240432129 & 2736\
    12784043267 & 12784043269 & 2946\
    13019808671 & 13019808673 & 2964\
    15717410207 & 15717410209 & 3156\
    17100765467 & 17100765469 & 3246\
    23211554291 & 23211554293 & 3594\
    29796600707 & 29796600709 & 3906\
    33362903807 & 33362903809 & 4056\
    39311389151 & 39311389153 & 4284\
    44837381087 & 44837381089 & 4476\
    53248211999 & 53248212001 & 4740\
    85200014591 & 85200014593 & 5544\
    94362064127 & 94362064129 & 5736\
    105110165267 & 105110165269 & 5946\
    111603347747 & 111603347749 & 6066\
    156246957827 & 156246957829 & 6786\
    169013118347 & 169013118349 & 6966\
    183838613471 & 183838613473 & 7164\
    215526633731 & 215526633733 & 7554\
    223322272991 & 223322272993 & 7644\
    226492415999 & 226492416001 & 7680\
    239472986111 & 239472986113 & 7824\
    280145695391 & 280145695393 & 8244\
    hline
    endarray
    $$

    This skips $2^3 = 3+5$ and $6^3 = 107+109$, and $24^3 = 6911 + 6913$ (although $6913 = 31cdot 223$, so that's irrelevant), because of some hiccup with the range in the primality test that I didn't bother fixing. Thanks to @taritgoswami for the prime test I copy-pasted from him and trimmed down a little. It still thinks $2$ is non-prime, but that's OK in this case. In fact, I could theoretically have taken away the whole parity check there, since I know I'm only feeding it odd numbers.



    The print statement is formatted like that so that I could copy-paste it directly from the Python output into a MathJaX array without having to manually type all the formatting necessary.






    share|cite|improve this answer











    $endgroup$



    $3$ and $5$ add to $2^3$, and $107 + 109 = 6^3$. So yes, there are other examples.



    Clearly the sum has to be even, so if you want to systematically look for examples, then you could look through numbers of the form
    $$
    frac(2n)^32pm 1
    $$

    and check whether they are twin primes. That's how I found the $6^3$ one, at least. I'm sure there are clever ways to cut down the search space further. Or maybe it's better to look through all twin primes and see whether they add to cubes. I have no idea which would actually be faster.




    Edit Apart from $3+5$, the primes cannot be divisible by $3$ (obviously), and since neither $p$ nor $p+2$ are divisible by $3$, that means their sum is divisible by $3$. So instead of just $frac(2n)^32pm1$, you can narrow it to $frac(6n)^32pm 1$.



    Once can do a similar analysis on the basis of, say, $5$, and find that $nnotequiv 2, 3pmod 5$, meaning the numerator must be on one of the forms $(30n)^3, (30n + 6)^3$ or $(30n + 24)^3$.




    New edit:



    I used my above idea to search with the following Python program:



    import math 

    def is_prime(n):
    if(n%2==0):
    return False
    for i in range(3,int(math.sqrt(n))+1,2):
    if(n%i==0):
    return False
    return True

    for i in range(1,300):
    for k in [30*i, 30*i + 6, 30*i + 24]:
    if is_prime(k**3/2 - 1) & is_prime(k**3/2 + 1):
    print "%d & %d & %d\\" % (k**3/2 - 1, k**3/2 + 1, k)


    (The speed of the program starts to go down at about 300.)



    It found the following list:
    $$
    beginarray
    hline
    p&p+2&sqrt[3]textsum\
    hline
    2634011 & 2634013 & 174\
    29659499 & 29659501 & 390\
    57395627 & 57395629 & 486\
    104792291 & 104792293 & 594\
    271669247 & 271669249 & 816\
    485149499 & 485149501 & 990\
    568946591 & 568946593 & 1044\
    588791807 & 588791809 & 1056\
    752530067 & 752530069 & 1146\
    863999999 & 864000001 & 1200\
    2032678367 & 2032678369 & 1596\
    2772616499 & 2772616501 & 1770\
    2945257307 & 2945257309 & 1806\
    3505869971 & 3505869973 & 1914\
    4473547487 & 4473547489 & 2076\
    4670303507 & 4670303509 & 2106\
    5470523999 & 5470524001 & 2220\
    6911999999 & 6912000001 & 2400\
    7498065347 & 7498065349 & 2466\
    8646803027 & 8646803029 & 2586\
    8828622431 & 8828622433 & 2604\
    8951240447 & 8951240449 & 2616\
    10240432127 & 10240432129 & 2736\
    12784043267 & 12784043269 & 2946\
    13019808671 & 13019808673 & 2964\
    15717410207 & 15717410209 & 3156\
    17100765467 & 17100765469 & 3246\
    23211554291 & 23211554293 & 3594\
    29796600707 & 29796600709 & 3906\
    33362903807 & 33362903809 & 4056\
    39311389151 & 39311389153 & 4284\
    44837381087 & 44837381089 & 4476\
    53248211999 & 53248212001 & 4740\
    85200014591 & 85200014593 & 5544\
    94362064127 & 94362064129 & 5736\
    105110165267 & 105110165269 & 5946\
    111603347747 & 111603347749 & 6066\
    156246957827 & 156246957829 & 6786\
    169013118347 & 169013118349 & 6966\
    183838613471 & 183838613473 & 7164\
    215526633731 & 215526633733 & 7554\
    223322272991 & 223322272993 & 7644\
    226492415999 & 226492416001 & 7680\
    239472986111 & 239472986113 & 7824\
    280145695391 & 280145695393 & 8244\
    hline
    endarray
    $$

    This skips $2^3 = 3+5$ and $6^3 = 107+109$, and $24^3 = 6911 + 6913$ (although $6913 = 31cdot 223$, so that's irrelevant), because of some hiccup with the range in the primality test that I didn't bother fixing. Thanks to @taritgoswami for the prime test I copy-pasted from him and trimmed down a little. It still thinks $2$ is non-prime, but that's OK in this case. In fact, I could theoretically have taken away the whole parity check there, since I know I'm only feeding it odd numbers.



    The print statement is formatted like that so that I could copy-paste it directly from the Python output into a MathJaX array without having to manually type all the formatting necessary.







    share|cite|improve this answer














    share|cite|improve this answer



    share|cite|improve this answer








    edited Apr 4 at 11:12

























    answered Apr 4 at 9:31









    ArthurArthur

    123k7122211




    123k7122211











    • $begingroup$
      some bigger one
      $endgroup$
      – user660792
      Apr 4 at 9:32










    • $begingroup$
      @DietrichBurde It's a cube, see the question body.
      $endgroup$
      – Arthur
      Apr 4 at 9:34










    • $begingroup$
      @DietrichBurde I'm sure we can. $17+19 = 6^2$, so $6$ is really prolific here.
      $endgroup$
      – Arthur
      Apr 4 at 9:37






    • 1




      $begingroup$
      with Maple can you find other examples?
      $endgroup$
      – user660792
      Apr 4 at 9:41










    • $begingroup$
      @pantareis I'm sure I could. If I knew how to use Maple. Or you could do it: I've already told you one possible algorithm.
      $endgroup$
      – Arthur
      Apr 4 at 9:42

















    • $begingroup$
      some bigger one
      $endgroup$
      – user660792
      Apr 4 at 9:32










    • $begingroup$
      @DietrichBurde It's a cube, see the question body.
      $endgroup$
      – Arthur
      Apr 4 at 9:34










    • $begingroup$
      @DietrichBurde I'm sure we can. $17+19 = 6^2$, so $6$ is really prolific here.
      $endgroup$
      – Arthur
      Apr 4 at 9:37






    • 1




      $begingroup$
      with Maple can you find other examples?
      $endgroup$
      – user660792
      Apr 4 at 9:41










    • $begingroup$
      @pantareis I'm sure I could. If I knew how to use Maple. Or you could do it: I've already told you one possible algorithm.
      $endgroup$
      – Arthur
      Apr 4 at 9:42
















    $begingroup$
    some bigger one
    $endgroup$
    – user660792
    Apr 4 at 9:32




    $begingroup$
    some bigger one
    $endgroup$
    – user660792
    Apr 4 at 9:32












    $begingroup$
    @DietrichBurde It's a cube, see the question body.
    $endgroup$
    – Arthur
    Apr 4 at 9:34




    $begingroup$
    @DietrichBurde It's a cube, see the question body.
    $endgroup$
    – Arthur
    Apr 4 at 9:34












    $begingroup$
    @DietrichBurde I'm sure we can. $17+19 = 6^2$, so $6$ is really prolific here.
    $endgroup$
    – Arthur
    Apr 4 at 9:37




    $begingroup$
    @DietrichBurde I'm sure we can. $17+19 = 6^2$, so $6$ is really prolific here.
    $endgroup$
    – Arthur
    Apr 4 at 9:37




    1




    1




    $begingroup$
    with Maple can you find other examples?
    $endgroup$
    – user660792
    Apr 4 at 9:41




    $begingroup$
    with Maple can you find other examples?
    $endgroup$
    – user660792
    Apr 4 at 9:41












    $begingroup$
    @pantareis I'm sure I could. If I knew how to use Maple. Or you could do it: I've already told you one possible algorithm.
    $endgroup$
    – Arthur
    Apr 4 at 9:42





    $begingroup$
    @pantareis I'm sure I could. If I knew how to use Maple. Or you could do it: I've already told you one possible algorithm.
    $endgroup$
    – Arthur
    Apr 4 at 9:42












    5












    $begingroup$

    To demonstrate that there are also huge solutions :



    Define $$k=10^100+303593$$ $$s=4k^3-1$$ $$t=4k^3+1$$ then $(s,t)$ is a twin prime pair of the desired form which can be searched with this PARI/GP - routine



    ? z=prod(j=1,3*10^4,prime(j));k=10^100-1;gef=0;while(gef==0,k=k+1;s=4*k^3-1;t=4*
    k^3+1;if(gcd(s*t,z)==1,if(ispseudoprime(s)==1,print(k-10^100);if(ispseudoprime(t)
    ==1,gef=1))))


    $ s $and $ t $ are proven primes with $ 301 $ digits. Assuming the generalized bunyakovsky conjecture, there are infinite many pairs of the desired form.






    share|cite|improve this answer









    $endgroup$

















      5












      $begingroup$

      To demonstrate that there are also huge solutions :



      Define $$k=10^100+303593$$ $$s=4k^3-1$$ $$t=4k^3+1$$ then $(s,t)$ is a twin prime pair of the desired form which can be searched with this PARI/GP - routine



      ? z=prod(j=1,3*10^4,prime(j));k=10^100-1;gef=0;while(gef==0,k=k+1;s=4*k^3-1;t=4*
      k^3+1;if(gcd(s*t,z)==1,if(ispseudoprime(s)==1,print(k-10^100);if(ispseudoprime(t)
      ==1,gef=1))))


      $ s $and $ t $ are proven primes with $ 301 $ digits. Assuming the generalized bunyakovsky conjecture, there are infinite many pairs of the desired form.






      share|cite|improve this answer









      $endgroup$















        5












        5








        5





        $begingroup$

        To demonstrate that there are also huge solutions :



        Define $$k=10^100+303593$$ $$s=4k^3-1$$ $$t=4k^3+1$$ then $(s,t)$ is a twin prime pair of the desired form which can be searched with this PARI/GP - routine



        ? z=prod(j=1,3*10^4,prime(j));k=10^100-1;gef=0;while(gef==0,k=k+1;s=4*k^3-1;t=4*
        k^3+1;if(gcd(s*t,z)==1,if(ispseudoprime(s)==1,print(k-10^100);if(ispseudoprime(t)
        ==1,gef=1))))


        $ s $and $ t $ are proven primes with $ 301 $ digits. Assuming the generalized bunyakovsky conjecture, there are infinite many pairs of the desired form.






        share|cite|improve this answer









        $endgroup$



        To demonstrate that there are also huge solutions :



        Define $$k=10^100+303593$$ $$s=4k^3-1$$ $$t=4k^3+1$$ then $(s,t)$ is a twin prime pair of the desired form which can be searched with this PARI/GP - routine



        ? z=prod(j=1,3*10^4,prime(j));k=10^100-1;gef=0;while(gef==0,k=k+1;s=4*k^3-1;t=4*
        k^3+1;if(gcd(s*t,z)==1,if(ispseudoprime(s)==1,print(k-10^100);if(ispseudoprime(t)
        ==1,gef=1))))


        $ s $and $ t $ are proven primes with $ 301 $ digits. Assuming the generalized bunyakovsky conjecture, there are infinite many pairs of the desired form.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Apr 4 at 11:34









        PeterPeter

        49.2k1240138




        49.2k1240138





















            4












            $begingroup$

            $(3,5),(107,109)$ and $(2634011,2634013)$ are only such twin prime pairs below $10^7$. You can check for more by increasing the range using this small Python code below. I just run it upto $10^8$, $(29659499,29659501)$ and $(57395627,57395629)$ are only such pairs with $10^7<p<10^8$.




            Edit:
            For optimization purpose, I will use the fact that all primes more than $3$ can be represented in the form $6kpm 1$.



            First let check manually for $p=2,3$. For $p=2$ it's clearly not possible. For $p=3$, we have $3+5=8=2^3$, so, $(3,5)$ is such pair.



            Suppose, $p=6k-1$, with $p>5$, then we have $12k=n^3$. That means, $12|n^3$. But, as $n^3$ is a perfect cube, and we have $12=3cdot 2^2$, at least $3^3cdot 2^3=216$ will divide $n^3$. So, the pair $(108m^3-1,108m^3+1)$ will be such pair if both of them are prime.



            While dealing with cubes, usually prefer to work in $mathbbZ_7$, as any cube is either of $0,1,6$ in this field,i.e; $n^3equiv 0,1,6pmod7$ . So, we can have $2p+2equiv 0pmod7$, which gives $pequiv 6pmod7$, or, $2p+2equiv 1pmod7$ which implies $pequiv 3pmod7$ or $2p+2equiv 6pmod7$ which implies $pequiv 2pmod7$. Hence, only $3$ pssibilities. Here is the updated program:



            import math
            import time

            start_time=time.time()
            def is_prime(n):
            flag=0
            if(n==2):
            return True
            if(n%2==0):
            return False
            else:
            for i in range(3,int(math.sqrt(n))+1,2):
            if(n%i==0):
            flag=1
            break
            if(flag==0):
            return True
            return False

            for i in range(1,1000):#change the number inside this braket to check for larger numbers
            c=(6*i)**3
            p=c//2-1
            if(p%7==2 or p%7==4 or p%7==6):
            if(is_prime(p) & is_prime(p+2)):
            print(p, "is such twin prime with sum",c)

            print(time.time()-start_time)





            share|cite|improve this answer











            $endgroup$












            • $begingroup$
              I am not the downvoter, but my guess is that it is because your script, the substance of your answer, is quite inefficient compared to some others that were posted.
              $endgroup$
              – Mees de Vries
              Apr 4 at 14:32










            • $begingroup$
              @MeesdeVries Updated it, please have a look.
              $endgroup$
              – tarit goswami
              Apr 4 at 19:20















            4












            $begingroup$

            $(3,5),(107,109)$ and $(2634011,2634013)$ are only such twin prime pairs below $10^7$. You can check for more by increasing the range using this small Python code below. I just run it upto $10^8$, $(29659499,29659501)$ and $(57395627,57395629)$ are only such pairs with $10^7<p<10^8$.




            Edit:
            For optimization purpose, I will use the fact that all primes more than $3$ can be represented in the form $6kpm 1$.



            First let check manually for $p=2,3$. For $p=2$ it's clearly not possible. For $p=3$, we have $3+5=8=2^3$, so, $(3,5)$ is such pair.



            Suppose, $p=6k-1$, with $p>5$, then we have $12k=n^3$. That means, $12|n^3$. But, as $n^3$ is a perfect cube, and we have $12=3cdot 2^2$, at least $3^3cdot 2^3=216$ will divide $n^3$. So, the pair $(108m^3-1,108m^3+1)$ will be such pair if both of them are prime.



            While dealing with cubes, usually prefer to work in $mathbbZ_7$, as any cube is either of $0,1,6$ in this field,i.e; $n^3equiv 0,1,6pmod7$ . So, we can have $2p+2equiv 0pmod7$, which gives $pequiv 6pmod7$, or, $2p+2equiv 1pmod7$ which implies $pequiv 3pmod7$ or $2p+2equiv 6pmod7$ which implies $pequiv 2pmod7$. Hence, only $3$ pssibilities. Here is the updated program:



            import math
            import time

            start_time=time.time()
            def is_prime(n):
            flag=0
            if(n==2):
            return True
            if(n%2==0):
            return False
            else:
            for i in range(3,int(math.sqrt(n))+1,2):
            if(n%i==0):
            flag=1
            break
            if(flag==0):
            return True
            return False

            for i in range(1,1000):#change the number inside this braket to check for larger numbers
            c=(6*i)**3
            p=c//2-1
            if(p%7==2 or p%7==4 or p%7==6):
            if(is_prime(p) & is_prime(p+2)):
            print(p, "is such twin prime with sum",c)

            print(time.time()-start_time)





            share|cite|improve this answer











            $endgroup$












            • $begingroup$
              I am not the downvoter, but my guess is that it is because your script, the substance of your answer, is quite inefficient compared to some others that were posted.
              $endgroup$
              – Mees de Vries
              Apr 4 at 14:32










            • $begingroup$
              @MeesdeVries Updated it, please have a look.
              $endgroup$
              – tarit goswami
              Apr 4 at 19:20













            4












            4








            4





            $begingroup$

            $(3,5),(107,109)$ and $(2634011,2634013)$ are only such twin prime pairs below $10^7$. You can check for more by increasing the range using this small Python code below. I just run it upto $10^8$, $(29659499,29659501)$ and $(57395627,57395629)$ are only such pairs with $10^7<p<10^8$.




            Edit:
            For optimization purpose, I will use the fact that all primes more than $3$ can be represented in the form $6kpm 1$.



            First let check manually for $p=2,3$. For $p=2$ it's clearly not possible. For $p=3$, we have $3+5=8=2^3$, so, $(3,5)$ is such pair.



            Suppose, $p=6k-1$, with $p>5$, then we have $12k=n^3$. That means, $12|n^3$. But, as $n^3$ is a perfect cube, and we have $12=3cdot 2^2$, at least $3^3cdot 2^3=216$ will divide $n^3$. So, the pair $(108m^3-1,108m^3+1)$ will be such pair if both of them are prime.



            While dealing with cubes, usually prefer to work in $mathbbZ_7$, as any cube is either of $0,1,6$ in this field,i.e; $n^3equiv 0,1,6pmod7$ . So, we can have $2p+2equiv 0pmod7$, which gives $pequiv 6pmod7$, or, $2p+2equiv 1pmod7$ which implies $pequiv 3pmod7$ or $2p+2equiv 6pmod7$ which implies $pequiv 2pmod7$. Hence, only $3$ pssibilities. Here is the updated program:



            import math
            import time

            start_time=time.time()
            def is_prime(n):
            flag=0
            if(n==2):
            return True
            if(n%2==0):
            return False
            else:
            for i in range(3,int(math.sqrt(n))+1,2):
            if(n%i==0):
            flag=1
            break
            if(flag==0):
            return True
            return False

            for i in range(1,1000):#change the number inside this braket to check for larger numbers
            c=(6*i)**3
            p=c//2-1
            if(p%7==2 or p%7==4 or p%7==6):
            if(is_prime(p) & is_prime(p+2)):
            print(p, "is such twin prime with sum",c)

            print(time.time()-start_time)





            share|cite|improve this answer











            $endgroup$



            $(3,5),(107,109)$ and $(2634011,2634013)$ are only such twin prime pairs below $10^7$. You can check for more by increasing the range using this small Python code below. I just run it upto $10^8$, $(29659499,29659501)$ and $(57395627,57395629)$ are only such pairs with $10^7<p<10^8$.




            Edit:
            For optimization purpose, I will use the fact that all primes more than $3$ can be represented in the form $6kpm 1$.



            First let check manually for $p=2,3$. For $p=2$ it's clearly not possible. For $p=3$, we have $3+5=8=2^3$, so, $(3,5)$ is such pair.



            Suppose, $p=6k-1$, with $p>5$, then we have $12k=n^3$. That means, $12|n^3$. But, as $n^3$ is a perfect cube, and we have $12=3cdot 2^2$, at least $3^3cdot 2^3=216$ will divide $n^3$. So, the pair $(108m^3-1,108m^3+1)$ will be such pair if both of them are prime.



            While dealing with cubes, usually prefer to work in $mathbbZ_7$, as any cube is either of $0,1,6$ in this field,i.e; $n^3equiv 0,1,6pmod7$ . So, we can have $2p+2equiv 0pmod7$, which gives $pequiv 6pmod7$, or, $2p+2equiv 1pmod7$ which implies $pequiv 3pmod7$ or $2p+2equiv 6pmod7$ which implies $pequiv 2pmod7$. Hence, only $3$ pssibilities. Here is the updated program:



            import math
            import time

            start_time=time.time()
            def is_prime(n):
            flag=0
            if(n==2):
            return True
            if(n%2==0):
            return False
            else:
            for i in range(3,int(math.sqrt(n))+1,2):
            if(n%i==0):
            flag=1
            break
            if(flag==0):
            return True
            return False

            for i in range(1,1000):#change the number inside this braket to check for larger numbers
            c=(6*i)**3
            p=c//2-1
            if(p%7==2 or p%7==4 or p%7==6):
            if(is_prime(p) & is_prime(p+2)):
            print(p, "is such twin prime with sum",c)

            print(time.time()-start_time)






            share|cite|improve this answer














            share|cite|improve this answer



            share|cite|improve this answer








            edited Apr 5 at 9:06

























            answered Apr 4 at 10:02









            tarit goswamitarit goswami

            2,2361422




            2,2361422











            • $begingroup$
              I am not the downvoter, but my guess is that it is because your script, the substance of your answer, is quite inefficient compared to some others that were posted.
              $endgroup$
              – Mees de Vries
              Apr 4 at 14:32










            • $begingroup$
              @MeesdeVries Updated it, please have a look.
              $endgroup$
              – tarit goswami
              Apr 4 at 19:20
















            • $begingroup$
              I am not the downvoter, but my guess is that it is because your script, the substance of your answer, is quite inefficient compared to some others that were posted.
              $endgroup$
              – Mees de Vries
              Apr 4 at 14:32










            • $begingroup$
              @MeesdeVries Updated it, please have a look.
              $endgroup$
              – tarit goswami
              Apr 4 at 19:20















            $begingroup$
            I am not the downvoter, but my guess is that it is because your script, the substance of your answer, is quite inefficient compared to some others that were posted.
            $endgroup$
            – Mees de Vries
            Apr 4 at 14:32




            $begingroup$
            I am not the downvoter, but my guess is that it is because your script, the substance of your answer, is quite inefficient compared to some others that were posted.
            $endgroup$
            – Mees de Vries
            Apr 4 at 14:32












            $begingroup$
            @MeesdeVries Updated it, please have a look.
            $endgroup$
            – tarit goswami
            Apr 4 at 19:20




            $begingroup$
            @MeesdeVries Updated it, please have a look.
            $endgroup$
            – tarit goswami
            Apr 4 at 19:20











            1












            $begingroup$

            $p + (p + 2) = 2p + 2 = 2(p + 1)$



            For the sum to be a cube, $p + 1$ must be divisible by 4, so that the sum becomes $2 times 4m^3$ for some integer $m$. So $p + 1$ is of the form $4m^3$.






            share|cite|improve this answer









            $endgroup$








            • 2




              $begingroup$
              Also, with the exception of the twin prime pair 3,5, every pair of twin primes must be of the form 6n-1,6n+1. Using your notation, you can further refine based on this to $p+1=108k^3$
              $endgroup$
              – Moko19
              Apr 4 at 9:52















            1












            $begingroup$

            $p + (p + 2) = 2p + 2 = 2(p + 1)$



            For the sum to be a cube, $p + 1$ must be divisible by 4, so that the sum becomes $2 times 4m^3$ for some integer $m$. So $p + 1$ is of the form $4m^3$.






            share|cite|improve this answer









            $endgroup$








            • 2




              $begingroup$
              Also, with the exception of the twin prime pair 3,5, every pair of twin primes must be of the form 6n-1,6n+1. Using your notation, you can further refine based on this to $p+1=108k^3$
              $endgroup$
              – Moko19
              Apr 4 at 9:52













            1












            1








            1





            $begingroup$

            $p + (p + 2) = 2p + 2 = 2(p + 1)$



            For the sum to be a cube, $p + 1$ must be divisible by 4, so that the sum becomes $2 times 4m^3$ for some integer $m$. So $p + 1$ is of the form $4m^3$.






            share|cite|improve this answer









            $endgroup$



            $p + (p + 2) = 2p + 2 = 2(p + 1)$



            For the sum to be a cube, $p + 1$ must be divisible by 4, so that the sum becomes $2 times 4m^3$ for some integer $m$. So $p + 1$ is of the form $4m^3$.







            share|cite|improve this answer












            share|cite|improve this answer



            share|cite|improve this answer










            answered Apr 4 at 9:36









            11235813211123581321

            352210




            352210







            • 2




              $begingroup$
              Also, with the exception of the twin prime pair 3,5, every pair of twin primes must be of the form 6n-1,6n+1. Using your notation, you can further refine based on this to $p+1=108k^3$
              $endgroup$
              – Moko19
              Apr 4 at 9:52












            • 2




              $begingroup$
              Also, with the exception of the twin prime pair 3,5, every pair of twin primes must be of the form 6n-1,6n+1. Using your notation, you can further refine based on this to $p+1=108k^3$
              $endgroup$
              – Moko19
              Apr 4 at 9:52







            2




            2




            $begingroup$
            Also, with the exception of the twin prime pair 3,5, every pair of twin primes must be of the form 6n-1,6n+1. Using your notation, you can further refine based on this to $p+1=108k^3$
            $endgroup$
            – Moko19
            Apr 4 at 9:52




            $begingroup$
            Also, with the exception of the twin prime pair 3,5, every pair of twin primes must be of the form 6n-1,6n+1. Using your notation, you can further refine based on this to $p+1=108k^3$
            $endgroup$
            – Moko19
            Apr 4 at 9:52



            Popular posts from this blog

            Adding axes to figuresAdding axes labels to LaTeX figuresLaTeX equivalent of ConTeXt buffersRotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?adding axes to shapesAlign axes across subfiguresAdding figures with a certain orderLine up nested tikz enviroments or how to get rid of themAdding axes labels to LaTeX figures

            Tähtien Talli Jäsenet | Lähteet | NavigointivalikkoSuomen Hippos – Tähtien Talli

            Do these cracks on my tires look bad? The Next CEO of Stack OverflowDry rot tire should I replace?Having to replace tiresFishtailed so easily? Bad tires? ABS?Filling the tires with something other than air, to avoid puncture hassles?Used Michelin tires safe to install?Do these tyre cracks necessitate replacement?Rumbling noise: tires or mechanicalIs it possible to fix noisy feathered tires?Are bad winter tires still better than summer tires in winter?Torque converter failure - Related to replacing only 2 tires?Why use snow tires on all 4 wheels on 2-wheel-drive cars?