Skip to main content
deleted 1 character in body
Source Link
Cowabunghole
  • 1.7k
  • 10
  • 21

05AB1E, 8 bytes

ÝDOnsnO-

ExplainationExplanation:

ÝDOnsnO-     //Full program
Ý            //Push [0..a] where a is implicit input
 D           //Duplicate top of stack
  On         //Push sum, then square it
    s        //Swap top two elements of stack
     nO      //Square each element, then push sum
       -     //Difference (implicitly printed)

Try it online!

05AB1E, 8 bytes

ÝDOnsnO-

Explaination:

ÝDOnsnO-     //Full program
Ý            //Push [0..a] where a is implicit input
 D           //Duplicate top of stack
  On         //Push sum, then square it
    s        //Swap top two elements of stack
     nO      //Square each element, then push sum
       -     //Difference (implicitly printed)

Try it online!

05AB1E, 8 bytes

ÝDOnsnO-

Explanation:

ÝDOnsnO-     //Full program
Ý            //Push [0..a] where a is implicit input
 D           //Duplicate top of stack
  On         //Push sum, then square it
    s        //Swap top two elements of stack
     nO      //Square each element, then push sum
       -     //Difference (implicitly printed)

Try it online!

Source Link
Cowabunghole
  • 1.7k
  • 10
  • 21

05AB1E, 8 bytes

ÝDOnsnO-

Explaination:

ÝDOnsnO-     //Full program
Ý            //Push [0..a] where a is implicit input
 D           //Duplicate top of stack
  On         //Push sum, then square it
    s        //Swap top two elements of stack
     nO      //Square each element, then push sum
       -     //Difference (implicitly printed)

Try it online!