Skip to main content
1 of 3
Neil
  • 177.2k
  • 12
  • 74
  • 281

Charcoal, 12 bytes

IΣE⊕N⁻Xι³Xι²

Try it online! Link is to verbose version of code. Explanation: \$ ( \sum x )^2 = \sum x^3 \$

    N           Input number
   ⊕            Incremented
  E             Map over implicit range i.e. 0 .. n
       ι  ι     Current value
        ³       Literal 3
           ²    Literal 2
      X  X      Power
     ⁻          Subtract
 Σ              Sum
I               Cast to string
                Implicitly print
Neil
  • 177.2k
  • 12
  • 74
  • 281