arithmetic implement conventional algorithm through Lua(luajit-2.1.0-beta3) proper tail recursion avoid stack overflow effectively.