You may write a small test program and try it yourself. It will fail at some N's because you may get into a dead loop.