Lua Prime Number Checker
snippet in lua

Lua Prime Number Checker

user268

function prime(n)
    for i = 2, n^(1/2) do
        if (n % i) == 0 then
            return false
        end
    end
    return true
end