summaryrefslogtreecommitdiff
path: root/progs/a910.py
blob: 8485252ce5d95df93313cdec9c4c676e274210f2 (plain)
1
2
3
4
5
6
7
def Total_Hamming_Distance(n):   
    i = 1
    sum = 0
    while (n // i > 0):  
        sum = sum + n // i  
        i = i * 2     
    return sum