Advertisement
Dimaush

Untitled

Nov 12th, 2024
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. def gcd(x, y):
  2.     while x != 0:
  3.         x, y = y % x, x
  4.     return y
  5.  
  6. def f(n):
  7.     for m in range(1, n ** 2 + 1):
  8.         if gcd(n, m) ** 3 == n * m:
  9.             print(m, end=' ')
  10.  
  11. for i in range(1, 200 + 1):
  12.     print(i, end=' ')
  13.     f(i)
  14.     print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement