dxnge

tsk 2

Nov 11th, 2021
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. import math
  2. #2 (x-12, x+12) -> 24 - 12
  3. # x == 12 + 2*k -->
  4. print(math.gcd((24+2*41)-12, (24+2*41)+12), 24+2*41)
  5. for i in range(101, 1000):
  6.     x = i
  7.     L = x - 12
  8.     M = x + 12
  9.     while L != M:
  10.         if L > M:
  11.             L -= M
  12.         else:
  13.             M -= L
  14.     if M == 2:
  15.         print(i)
  16.         break
  17.  
Advertisement
Add Comment
Please, Sign In to add comment