Guest User

Untitled

a guest
Apr 24th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. from math import sqrt
  2. from itertools import combinations
  3.  
  4. def isP(n):
  5. return (1/6*(sqrt(24*n+1)+1)).is_integer()
  6.  
  7. p = [n*(3*n-1)/2 for n in range(1,2500)]
  8.  
  9. for x in combinations(p, 2):
  10. if (isP(x[0]+x[1]) and isP(x[1]-x[0])):
  11. print(x)
Add Comment
Please, Sign In to add comment