login
Inverse Stolarsky array read by antidiagonals.
7

%I #22 Jun 01 2019 17:13:15

%S 1,2,4,3,7,12,5,9,20,33,6,14,25,54,88,8,17,38,67,143,232,10,22,46,101,

%T 177,376,609,11,27,59,122,266,465,986,1596,13,30,72,156,321,698,1219,

%U 2583,4180,15,35,80,190,410,842,1829,3193,6764,10945,16,41,93,211,499

%N Inverse Stolarsky array read by antidiagonals.

%C The inverse Stolarky array is the dispersion of the sequence u given by u(n) = floor(n*x + x + n + 1 - x/2), where x=(golden ratio). For a discussion of dispersions, see A191426.

%H C. Kimberling, <a href="http://faculty.evansville.edu/ck6/integer/intersp.html">Interspersions</a>

%H C. Kimberling, <a href="https://doi.org/10.1090/S0002-9939-1993-1111434-0">Interspersions and dispersions</a>, Proceedings of the American Mathematical Society 117 (1993) 313-321.

%H N. J. A. Sloane, <a href="/classic.html#WYTH">Classic Sequences</a>

%F The term in row n and column k of the inverse Stolarsky array has the following expression: a(n, k) = F(2k-3) - 1 - c1(n)*F(2k-4) + c2(n)*F(2k-2), where F is the Fibonacci sequence; c1(n)=1 if n=1, [(n-1)*tau] if n>1 (first column of the Inverse Stolarsky array) and c2(n) = c1(n) + 1 + floor((2*c1(n)+1)*tau/2) (second column of the Inverse Stolarsky array). tau = (1+sqrt(5))/2 and [] denotes the nearest integer function. - C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 31 2004

%F Also, the following recurrence holds: a(n, k) = 3*a(n, k-1) - a(n, k-2) + 1 with a(n, 1)=c1(n) and a(n, 2)=c2(n). - C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 31 2004

%e Top left hand corner of array:

%e 1, 4, 12, 33, 88, 232, ...

%e 2, 7, 20, 54, 143, 376, ...

%e 3, 9, 25, 67, 177, 465, ...

%e 5, 14, 38, 101, 266, 698, ...

%e 6, 17, 46, 122, 321, 842, ...

%p with(combinat, fibonacci): gold:=(1+sqrt(5))/2: c1:=n->piecewise(n<>1,round((n-1)*gold),1): c2:=n->c1(n)+floor((2*c1(n)+1)*gold/2)+1: inv_stol:=(n,k)->fibonacci(2*k-3)-1-c1(n)*fibonacci(2*k-4)+c2(n)*fibonacci(2*k-2): seq(seq(inv_stol(n+1-k,k),k=1..n),n=1..11); inv_stol2:=(n,k)->(1+c0(n))*fibonacci(2*k-3)+(1+floor((2*c0(n)+1)*gold/2))*fibonacci(2*k-2)-1:seq(seq(inv_stol2(n+1-k,k),k=1..n),n=1..11); # C. Ronaldo, Dec 31 2004

%t (* program generates the dispersion array T of the complement of increasing sequence f[n] *)

%t r = 40; r1 = 12; (* r=# rows of T, r1=# rows to show *)

%t c = 40; c1 = 12; (* c=# cols of T, c1=# cols to show *)

%t x = GoldenRatio; f[n_] := Floor[n*x + x + n + 1 - x/2] (* f(n) is complement of column 1 *)

%t mex[list_] :=

%t NestWhile[#1 + 1 &, 1, Union[list][[#1]] <= #1 &, 1,

%t Length[Union[list]]]

%t rows = {NestList[f, 1, c]};

%t Do[rows = Append[rows, NestList[f, mex[Flatten[rows]], r]], {r}];

%t t[i_, j_] := rows[[i, j]]; (* the array T *)

%t TableForm[Table[t[i, j], {i, 1, 10}, {j, 1, 10}]]

%t (* Inverse Stolarsky array, A035507 *)

%t Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]]

%t (* array as a sequence *)

%t (* Program by _Peter J. C. Moses_, Jun 01 2011 *)

%Y Cf. A035506 (Stolarsky array), A191426.

%K nonn,tabl,easy,nice

%O 0,2

%A _N. J. A. Sloane_

%E More terms from C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 31 2004

%E Mathematica program, extended example, and comments from _Clark Kimberling_, Jun 03 2011