def solve(): i = 1 not_found = True while True: i += 1 j = pentagon(i) for m in range(i-1,0,-1): k = pentagon(m) if pentagonal(j-k) and pentagonal(j+k): return abs(j-k) break
def solve(): a = 286 while True: tri = triangle(a) if pentagonal(tri) and hexagonal(tri): return tri a += 1