OFFSET
1,2
COMMENTS
Background discussion: Suppose that s is an increasing sequence of positive integers, that the complement t of s is infinite, and that t(1)=1. The dispersion of s is the array D whose n-th row is (t(n), s(t(n)), s(s(t(n))), s(s(s(t(n)))), ...). Every positive integer occurs exactly once in D, so that, as a sequence, D is a permutation of the positive integers. The sequence u given by u(n)=(number of the row of D that contains n) is a fractal sequence. Examples:
EXAMPLE
Northwest corner:
1...2...4...7...11
3...5...12..18..18
6...9...14..21..31
10..15..22..32..46
13..19..28..41..59
MATHEMATICA
(* Program generates the dispersion array T of increasing sequence f[n] *)
r = 40; r1 = 12; (* r=# rows of T to compute, r1=# rows to show *)
c = 40; c1 = 12; (* c=# cols to compute, c1=# cols to show *)
x = Sqrt[2];
f[n_] := Floor[n*x + 3/2] (* f(n) is complement of column 1 *)
mex[list_] :=
NestWhile[#1 + 1 &, 1, Union[list][[#1]] <= #1 &, 1,
Length[Union[list]]]
rows = {NestList[f, 1, c]};
Do[rows = Append[rows, NestList[f, mex[Flatten[rows]], r]], {r}];
t[i_, j_] := rows[[i, j]]; (* the array T *)
TableForm[
Table[t[i, j], {i, 1, 10}, {j, 1, 10}]] (* A191430 array *)
Flatten[Table[
t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A191430 sequence *)
(* Program by Peter J. C. Moses, Jun 01 2011 *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Clark Kimberling, Jun 03 2011
STATUS
approved