Skip to main content
4 of 4
Commonmark migration

Japt, 13 12 11 bytes


sw
*V/yU ²

Try it


Explanation

Implicit input of integer U. The empty line at the beginning, prevents the following line from overwriting U

sw

Convert U to a string (s), reverse it (w), convert back to an integer and assign to variable V.

*V

Multiply U by V.

/

Divide.

yU

GCD of V and U.

²

Squared. Implicit output of resulting integer.


Alternative, 13 bytes

Just because I like being able to use N.

NpUsw)mxNry)×

Try it

Shaggy
  • 43.5k
  • 4
  • 36
  • 94