Introduce an is_prime function
Added prime checker
Explain the pivotal prime logic
Moved if statment around.
Converted while into for loop.
Removed Variable I tracking #P.
Renamed Variables. Removed explicit declarations.
don't explain lua syntax
Don't print primes. Move IO into main() function.
M is superflous, since we allocate V dynamically
N becomes a function argument
Literal translation to lua