I'm absurdly excited to learn that 2024 = 2³+3³+4³+5³+6³+7³+8³+9³.
...and it's because:
2025 = 45², and
45=1+2+⋯+9, and
(1+⋯+𝑛)²=1³+⋯+𝑛³ !
Via https://www.reddit.com/r/math/comments/18tr14a/2024_2³3³4³5³6³7³8³9³/.
I'm absurdly excited to learn that 2024 = 2³+3³+4³+5³+6³+7³+8³+9³.
...and it's because:
2025 = 45², and
45=1+2+⋯+9, and
(1+⋯+𝑛)²=1³+⋯+𝑛³ !
Via https://www.reddit.com/r/math/comments/18tr14a/2024_2³3³4³5³6³7³8³9³/.
@ddrake a python two-liner...
`>>> nums = list(range(2, 10, 1))`
`>>> sum([num**3 for num in nums])`
## 2024
@beepcheck @ddrake
1-liner, which also takes less memory, as it never produces all of nums at once:
sum(n**3 for n in range(2,10))
it's actually about 25% faster to do
sum(map(lambda n: n**3, range(2,10)))
- but the difference will only be seen on much bigger ranges