int n = 1000;
int [] d = new int [n];
for (int i=2; i<n; i++) { d[i]=1; }
for (int j=2; j<n; j++) {
int c = 0;
for (int i=n-1; i>=1; i--) {
int h = 10 * d[i] + c;
d[i] = h % i; c = h / i;
}
System.out.print(c); System.out.flush();
}
(wieviel weiter darf die j-Schleife noch gehen?)