fork download
  1. # your code goes here
  2. def f(x):
  3. return sum([(i*(i+1)*len(`i`))/2 for i in range(x + 1)])
  4.  
  5. for i in [1,2,3,10,50,100,150]:
  6. print(f(i))
Success #stdin #stdout 0.01s 23352KB
stdin
Standard input is empty
stdout
1
4
10
275
44035
348285
1554585