dxnge

15

Nov 2nd, 2021
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.17 KB | None | 0 0
  1. nums = list(map(int, open('17-4.txt')))
  2. gen = [max(gip) for gip in zip(nums, nums[1::], nums[2::]) if sum([n**2 for n in gip]) == (max(gip)**2)*2]
  3. print(len(gen), sum(gen))
Advertisement
Add Comment
Please, Sign In to add comment