Skip to main content
2 of 3
deleted 138 characters in body
FryAmTheEggman
  • 17.5k
  • 3
  • 40
  • 97

##Pyth - 15 10 * .5 = 5

smr-QdhQUQ

Try it online.

Expects input on stdin. Independently discovered algorithm. Thanks @Sp3000 for helping me stick the last Q in there :P Also, irony? XD

Explanation:

Q=eval(input())       : implicit
s                     : The sum of...
 m      UQ            : map(...,range(Q))
  r-QdhQ              : range(Q-d,Q+1)
     
FryAmTheEggman
  • 17.5k
  • 3
  • 40
  • 97