A simple JS nth prime calculator