Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function prime(n)
- for i = 2, n^(1/2) do
- if (n % i) == 0 then
- return false
- end
- end
- return true
- end
- -- This script calculates prime numbers.
- local num = 0
- while true do
- num = num + 1
- if prime(num) then
- print(num)
- end
- sleep(0.05)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement