Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Weird solution in Creative category for Saw the Stick by obone
from math import sqrt
def checkio(number):
tri = [n * (n + 1) / 2 for n in range(1, round(sqrt(2 * number) + 1))]
slices = {sum(tri[-k:-i]) : (-k, -i) for i in range(1, len(tri) + 1) \
for k in range(i, len(tri) + 1)}
return tri[slice(*slices[number])] if number in slices.keys() else []
July 14, 2019