http://qs321.pair.com?node_id=374942

sub e { $N=pop;$a[$_]=int(1+1/$_)for 1..$N;for(;$N>9;print int$x) {for($n=$N--;--$n;$a[$n]=$x%$n,$x=10*$a[$n-1]+$x/$n){}} } e(1000);

NB: Based on work by Xavier Gourdon e

cheers

tachyon