def mySum(k, n): return n * sum([ n1 * n2 for n1, n2 in zip( [ i + 1 for i in range(k) ], [ 10 ** (k - i - 1) for i in range(k) ])])