Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
public class Test {
|
||||
|
||||
static boolean valid(int n, int nuts) {
|
||||
for (int k = n; k != 0; k--, nuts -= 1 + nuts / n)
|
||||
if (nuts % n != 1)
|
||||
return false;
|
||||
return nuts != 0 && (nuts % n == 0);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
int x = 0;
|
||||
for (int n = 2; n < 10; n++) {
|
||||
while (!valid(n, x))
|
||||
x++;
|
||||
System.out.printf("%d: %d%n", n, x);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue