OFFSET
1,2
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
T. D. Noe, Plot of first 5000 terms
A post on sci.math.research newsgroup.
FORMULA
a(1, j)=1 for all j>=1; a(n, j)=a(n-1, j) except when #{i<=j s.t. a(n-1, i)=a(n-1, j)} is multiple of n, in which case a(n, j)=n; a(j) is the limit of the (stationary) a(n, j) when n tends to infinity.
It appears that the maximal value among the first n terms grows like sqrt(4n/3).
EXAMPLE
Here are the first 6 stages in the construction:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2...
1 2 1 2 3 3 1 2 1 2 3 3 1 2 1 2 3 3 1 2 1 2 3 3 1 2 1 2 3 3...
1 2 1 2 3 3 1 2 4 4 3 4 1 2 1 2 3 3 1 2 4 4 3 4 1 2 1 2 3 3...
1 2 1 2 3 3 1 2 4 4 3 4 1 2 5 5 3 5 1 2 4 5 3 4 1 2 1 2 3 3...
1 2 1 2 3 3 1 2 4 4 3 4 1 2 5 5 3 5 1 2 4 5 3 4 6 6 1 2 6 3...
...
MATHEMATICA
nn=100; t=Table[1, {nn}]; done=False; k=1; While[ !done, k++; cnt=Table[0, {k-1}]; Do[If[t[[i]]<k, cnt[[t[[i]]]]++; If[Mod[cnt[[t[[i]]]], k]==0, t[[i]]=k]], {i, nn}]; done=(Max[cnt]<k)]; t (* T. D. Noe *)
a[n_] := Fold[Function[{b1, b2}, Fold[Function[{a1, a2}, ReplacePart[a1, Pick[Position[a1, a2], Take[Flatten[Array[{Array[0 &, b2 - 1], 1} &, Length[a1]]], Length[Position[a1, a2]]], 1] -> b2]], b1, Range[b2 - 1]]], Array[1 &, n], Range[2, 2 Sqrt[n/Pi] + 1]]; a[100] (* Birkas Gyorgy, Feb 06 2011 *)
PROG
/* C */ #define MAXVAL 2048 /* Large enough... */ unsigned int counts[MAXVAL][MAXVAL]; /* Initialized at all 0 */ unsigned int seq_value (void) /* Successive calls return values in the sequence, in order. */ { unsigned int value; unsigned int i; value = 1; for ( i=2; i<MAXVAL; i++ ) if ( ++counts[i][value] >= i ) { counts[i][value] = 0; value = i; } return value; }
CROSSREFS
KEYWORD
easy,nice,nonn
AUTHOR
David A. Madore, Oct 25 2004
STATUS
approved