View Single Post
Old 2018-12-03, 16:35   #5
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by goldbug View Post
2n minus each prime equals the other prime to a power.

let p1 be p, let p2 be q there are 4 main cases at play (assuming p,q aren't 2):

q is 3 mod 4, is raised to an odd power, and n is odd, leading to p is 3 mod 4

q is 3 mod 4, is raised to an odd power, and n is even, leading to p is 1 mod 4

q is raised to an even power, and n is odd, leading to p is 1 mod 4

q is raised to an even power, and n is even, leading to p is 3 mod 4

now just put it into practice in code.
science_man_88 is offline   Reply With Quote