Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m="1234567891" p=tonumber(m) p2=1 function f(g,j) print(g.." is not a prime number: "..g..j) end function t(t) print(m.." is a prime number.") end if p==2 then t() return elseif p<=1 then f(m," is below or equal to 1.") return elseif p/2==math.floor(p/2) then f(p,"/2="..p/2) return end for i=3,math.sqrt(p),2 do if math.floor(p/i)==p/i then f(p,"/"..i.."="..p/i) p2=0 return end end if p2==1 then t() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement