Skip to main content
3 of 3
added 103 characters in body
tsh
  • 35.6k
  • 2
  • 34
  • 129

Python, 44 bytes

lambda k:sum(i*(k%i<1)for i in range(1,1+k))
  • Thanks to Stephen, save 1 byte by removing whitespace.
  • Thanks to Jonathan Frech, save another 1 byte by changing if to multiply.
tsh
  • 35.6k
  • 2
  • 34
  • 129