Solve problem 21 using Lua.