OFFSET
1,2
LINKS
R. Anderson, L. Lovász, P. Shor, J. Spencer, E. Tardos, S. Winograd, Disks, balls and walls: analysis of a combinatorial game, Amer. Math. Monthly, 6, 96, pp. 481-493, 1989.
FORMULA
The sequence is asymptotically quadratic with a(n) ~= c*n^2, where c is between 0.33 and 0.65, with estimate 0.5973 for n = 10000.
EXAMPLE
E.g., a(2) = 3 because there are 3 steps in the process beginning with 4 tokens:
0 0 4 0 0
0 2 0 2 0
1 0 2 0 1
1 1 0 1 1
PROG
(C)
#include <stdio.h>
#include <string.h>
#define N 1000
#define NN (2 * (N / 2) + 1)
void e(int *t, int *T) {
int i;
for (i = 0; i < NN; i ++) {
T[i] += (t[i] % 2); int f = (t[i] / 2);
if (f) { T[i - 1] += f; T[i + 1] += f; }
}
}
int f(int n) {
int t[NN], T[NN], i = 0;
memset(t, 0, sizeof(t)); memset(T, 0, sizeof(T));
t[N / 2] = n; e(t, T);
while (memcmp(t, T, sizeof(t)) != 0) { i ++; memcpy(t, T, sizeof(T)); memset(T, 0, sizeof(T)); e(t, T); }
return i;
}
int main() { int n; for (n = 2; n <= N; n += 2) { printf("%d, ", f(n)); fflush(stdout); } printf("\n"); }
/* Luc Rousseau, Jun 29 2018 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Rob Arthan, Oct 17 2003
STATUS
approved