from sys import stdin scan = lambda : stdin.readline() def gcd(a,b): if b==0: return a return gcd(b,a%b) while True: num = int(scan()) if num ==0: break sum=0 for i in range(1,num): for j in range(i+1,num+1): sum = sum + gcd(i,j) print(sum)
Subscribe to:
Post Comments (Atom)
-
/*** Md. Nazmul Hasan Shahjalal University of Science & Technology,Sylhet. hasan08sust@gmail.com ***/ #include<iostream> #i...
-
n = 1 while n: str = input () # print('Case no# %d :'%n) if str == ' * ' : break if str == ' Hajj ...
-
/*** Md. Namzul Hasan Shahjalal University of Science & technology,sylhet. hasan08sust@gmail.com ***/ #include<bits/stdc++.h...
No comments:
Post a Comment