Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import sqrt
- from itertools import combinations
- def isP(n):
- return (1/6*(sqrt(24*n+1)+1)).is_integer()
- p = [n*(3*n-1)/2 for n in range(1,2500)]
- for x in combinations(p, 2):
- if (isP(x[0]+x[1]) and isP(x[1]-x[0])):
- print(x)
Add Comment
Please, Sign In to add comment