Post History
Lua 5.4, 9 bytes n^.5%1==0 Try it online! The entire compressed code is 33 bytes: function f(n)return n^.5%1==0 end Try it here. It's not clear whether the rules allow the first form (i...
Answer
#1: Initial revision
# [Lua 5.4](https://www.lua.org/versions.html#5.4), 9 bytes ``` lua n^.5%1==0 ``` [Try it online!](https://tio.run/##bY0xCgIxEEVrc4ppJBlYQ1JY5gqyJxCW3YwEZKKzk867x6DY@cv/eP/f29Kp8aqlMpBjBMnahDtf/fkYUwo982bMQwqrsxc7gX3BnIXyqrA/2yLZ4g@f/mZwQ1WgQII4QQwBtmoOX6d8Bq33Wncdzc2RK4hoxm1/Aw) ---- The entire compressed code is 33 bytes: ``` lua function f(n)return n^.5%1==0 end ``` [Try it here.](https://tio.run/##bY1BDsIgFETXcorZGCBpCSxccgXjCUyaFgyJ@ejvZ@fdsVaXznJe3sy9Tb3nRrOUSsiGLCdpTKCrOx1DjB6Jlv7gQmL0WQ/QL1wS5zQL1mebOGmrfnj8m42rXBkFEWFA8B5LVYevU/ZB7ZzUVbbmZrIp1lr1eX0D) It's not clear whether the rules allow the first form (i.e. only the relevant expression) or the second form (i.e. the entire piece of code that does the check). I see some use the former, some use the latter.