|
|
A100002
|
|
Start with a sequence of 1's, then replace every other 1 with a 2; then replace every third of the remaining 1's with a 3 and every third of the remaining 2's with a 3; then replace every fourth remaining 1, 2 or 3 with a 4; and so on. The limiting sequence is shown here.
|
|
6
|
|
|
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, 7, 7, 6, 4, 7, 7, 5, 6, 1, 2, 5, 3, 8, 8, 7, 4, 8, 8, 1, 2, 6, 7, 3, 6, 5, 8, 4, 8, 5, 6, 9, 9, 1, 2, 9, 3, 10, 10, 9, 4, 10, 10, 7, 8, 9, 5, 7, 10, 1, 2, 9, 7, 3, 4, 9, 6, 11, 11, 10, 11
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
|
|
LINKS
|
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
|
Cf. A100287 (first occurrence of n).
|
|
KEYWORD
|
easy,nice,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|