N=180 Aided by Excel only.
edited : I have erroneously started with N(0)=1991,
and continued : h(K)=mod(N(K),1991)
So the value 0 is reached when N=182 (corrected answer).
Edited on January 29, 2016, 3:44 pm
flooble's webmaster puzzle