def mysum(a): sum = 0 for i in range(a): tmp = "" for j in range(i + 1): tmp += str(a) sum += int(tmp) return sum