A035513 Wythoff array read by falling antidiagonals.
1, 2, 4, 3, 7, 6, 5, 11, 10, 9, 8, 18, 16, 15, 12, 13, 29, 26, 24, 20, 14, 21, 47, 42, 39, 32, 23, 17, 34, 76, 68, 63, 52, 37, 28, 19, 55, 123, 110, 102, 84, 60, 45, 31, 22, 89, 199, 178, 165, 136, 97, 73, 50, 36, 25, 144, 322, 288, 267, 220, 157, 118, 81, 58, 41, 27, 233, 521
Offset: 1
A035506 Stolarsky array read by antidiagonals.
1, 2, 4, 3, 6, 7, 5, 10, 11, 9, 8, 16, 18, 15, 12, 13, 26, 29, 24, 19, 14, 21, 42, 47, 39, 31, 23, 17, 34, 68, 76, 63, 50, 37, 28, 20, 55, 110, 123, 102, 81, 60, 45, 32, 22, 89, 178, 199, 165, 131, 97, 73, 52, 36, 25, 144, 288, 322, 267, 212, 157, 118, 84, 58, 40, 27, 233, 466, 521, 432, 343, 254, 191, 136, 94, 65, 44, 30
Offset: 0
Comments
Inverse of sequence A064357 considered as a permutation of the positive integers. - Howard A. Landman, Sep 25 2001
The PARI/GP script gives a general solution for the Stolarsky array in square array form by row, column. Increase the default precision to compute large values in the array. - Randall L Rathbun, Jan 25 2002
The Stolarsky array is the dispersion of the sequence s given by s(n)=(integer nearest n*x), where x=(golden ratio). For a discussion of dispersions, see A191426.
See A098861 for the row in which is a given number. - M. F. Hasler, Nov 05 2014
Named after the American mathematician Kenneth Barry Stolarsky. - Amiram Eldar, Jun 11 2021
Examples
Top left corner of the array is: 1 2 3 5 8 13 21 34 55 4 6 10 16 26 42 68 110 178 7 11 18 29 47 76 123 119 322 9 15 24 39 63 102 165 267 432 12 19 31 50 81 131 212 343 555 14 23 37 60 97 157 254 411 665
References
- C. Kimberling, "Stolarsky interspersions," Ars Combinatoria 39 (1995) 129-138.
Links
- Alois P. Heinz, Antidiagonals n = 0..140, flattened
- Clark Kimberling, Interspersions.
- Clark Kimberling, Interspersions and dispersions, Proceedings of the American Mathematical Society, Vol. 117 (1993), pp. 313-321.
- David R. Morrison, A Stolarsky array of Wythoff pairs, A collection of manuscripts related to the Fibonacci sequence, Santa Clara, CA: Fibonacci Association, 1980, pp. 134-136.
- N. J. A. Sloane, Classic Sequences.
- Eric Weisstein's World of Mathematics, Stolarsky arrays.
- Index entries for sequences that are permutations of the natural numbers
Crossrefs
Programs
-
Maple
A:= proc(n, k) local t, a, b; t:= (1+sqrt(5))/2; a:= floor(n*(t+1)+1 +t/2); b:= round(a*t); (Matrix([[b, a]]). Matrix([[1, 1], [1, 0]])^k) [1, 2] end: seq(seq(A (n, d-n), n=0..d), d=0..10); # Alois P. Heinz, Aug 17 2008
-
Mathematica
(* program generates the dispersion array T of the complement of increasing sequence f[n] *) r = 40; r1 = 12; (* r=# rows of T, r1=# rows to show *) c = 40; c1 = 12; (* c=# cols of T, c1=# cols to show *) x = GoldenRatio; f[n_] := Floor[n*x + 1/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]]; TableForm[Table[t[i, j], {i, 1, 10}, {j, 1, 10}]] (* t=Stolarsky array, A035506 *) Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* Stolarsky array as a sequence *) (* Program by Peter J. C. Moses, Jun 01 2011 *) (* Second program: *) A[n_, k_] := Module[{t, a, b}, t = (1+Sqrt[5])/2; a = Floor[n*(t+1)+1+t/2]; b = Round[a*t]; ({b, a}.MatrixPower[{{1, 1}, {1, 0}}, k])[[2]]]; Table[A[n, d-n], {d, 0, 11}, {n, 0, d}] // Flatten (* Jean-François Alcover, Mar 22 2023, after Alois P. Heinz *)
-
PARI
{Stolarsky(r,c)= tau=(1+sqrt(5))/2; a=floor(r*(1+tau)-tau/2); b=round(a*tau); if(c==1,a, if(c==2,b, for(i=1,c-2,d=a+b; a=b; b=d; ); d))} \\ Randall L Rathbun, Jan 25 2002
Formula
T(1,k) = 2*T(0,k+1); T(3,k) = 3*T(0,k+2). - M. F. Hasler, Nov 05 2014
Extensions
More terms from Larry Reeves (larryr(AT)acm.org), Sep 27 2000
Extended (terms, Mathematica, example) by Clark Kimberling, Jun 03 2011
Example corrected by M. F. Hasler, Nov 05 2014
A191455 Dispersion of (floor(n*e)), by antidiagonals.
1, 2, 3, 5, 8, 4, 13, 21, 10, 6, 35, 57, 27, 16, 7, 95, 154, 73, 43, 19, 9, 258, 418, 198, 116, 51, 24, 11, 701, 1136, 538, 315, 138, 65, 29, 12, 1905, 3087, 1462, 856, 375, 176, 78, 32, 14, 5178, 8391, 3974, 2326, 1019, 478, 212, 86, 38, 15, 14075, 22809
Offset: 1
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:
Examples
Northwest corner: 1...2....5....13...35 3...8....21...57...154 4...10...27...73...198 6...16...43...116..315 7...19...51...138..375
Programs
-
Maple
A191455 := proc(r, c) option remember; if c = 1 then A054385(r) ; else A022843(procname(r, c-1)) ; end if; end proc: # R. J. Mathar, Jan 25 2015
-
Mathematica
(* Program generates the dispersion array T of increasing sequence f[n] *) r=40; r1=12; c=40; c1=12; f[n_] :=Floor[n*E] (* 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]]; TableForm[Table[t[i, j], {i, 1, 10}, {j, 1, 10}]] (* A191455 array *) Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A191455 sequence *) (* Program by Peter J. C. Moses, Jun 01 2011 *)
A191667 Dispersion of A016813 (4k+1, k>1), by antidiagonals.
1, 5, 2, 21, 9, 3, 85, 37, 13, 4, 341, 149, 53, 17, 6, 1365, 597, 213, 69, 25, 7, 5461, 2389, 853, 277, 101, 29, 8, 21845, 9557, 3413, 1109, 405, 117, 33, 10, 87381, 38229, 13653, 4437, 1621, 469, 133, 41, 11, 349525, 152917, 54613, 17749, 6485, 1877, 533
Offset: 1
Comments
For a background discussion of dispersions, see A191426.
...
Each of the sequences (4n, n>2), (4n+1, n>0), (3n+2, n>=0), generates a dispersion. Each complement (beginning with its first term >1) also generates a dispersion. The six sequences and dispersions are listed here:
...
...
EXCEPT for at most 2 initial terms (so that column 1 always starts with 1):
...
Regarding the dispersions A191670-A191673, there is a formula for sequences of the type "(a or b or c mod m)", (as in the Mathematica program below):
If f(n)=(n mod 3), then (a,b,c,a,b,c,a,b,c,...) is given by a*f(n+2)+b*f(n+1)+c*f(n), so that "(a or b or c mod m)" is given by a*f(n+2)+b*f(n+1)+c*f(n)+m*floor((n-1)/3)), for n>=1.
Examples
Northwest corner: 1....5....21....85....341 2....9....37....149...597 3....13...53....213...853 4....17...69....277...1109 6....25...101...405...1621
Links
- Ivan Neretin, Table of n, a(n) for n = 1..5050 (first 100 antidiagonals, flattened)
Programs
-
Mathematica
(* Program generates the dispersion array T of the increasing sequence f[n] *) r = 40; r1 = 12; c = 40; c1 = 12; f[n_] := 4*n+1 Table[f[n], {n, 1, 30}] (* A016813 *) 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]]; TableForm[Table[t[i, j], {i, 1, 10}, {j, 1, 10}]] (* A191667 *) Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A191667 *)
A191663 Dispersion of A042948 (numbers >3, congruent to 0 or 1 mod 4), by antidiagonals.
1, 4, 2, 9, 5, 3, 20, 12, 8, 6, 41, 25, 17, 13, 7, 84, 52, 36, 28, 16, 10, 169, 105, 73, 57, 33, 21, 11, 340, 212, 148, 116, 68, 44, 24, 14, 681, 425, 297, 233, 137, 89, 49, 29, 15, 1364, 852, 596, 468, 276, 180, 100, 60, 32, 18, 2729, 1705, 1193, 937, 553
Offset: 1
Comments
Row 1: A084639.
For a background discussion of dispersions, see A191426.
...
Each of the sequences (4n, n>2), (4n+1, n>0), (3n+2, n>=0), generates a dispersion. Each complement (beginning with its first term >1) also generates a dispersion. The six sequences and dispersions are listed here:
...
...
EXCEPT for at most 2 initial terms (so that column 1 always starts with 1):
...
There is a formula for sequences of the type "(a or b mod m)", (as in the Mathematica program below):
If f(n)=(n mod 2), then (a,b,a,b,a,b,...) is given by
a*f(n+1)+b*f(n), so that "(a or b mod m)" is given by
a*f(n+1)+b*f(n)+m*floor((n-1)/2)), for n>=1.
Examples
Northwest corner: 1...4...9....20...41 2...5...12...25...52 3...8...17...36...73 6...13..28...57...116 7...16..33...68...137
Links
- Ivan Neretin, Table of n, a(n) for n = 1..5050 (first 100 antidiagonals, flattened)
Programs
-
Mathematica
(* Program generates the dispersion array T of the increasing sequence f[n] *) r = 40; r1 = 12; c = 40; c1 = 12; a = 4; b = 5; m[n_] := If[Mod[n, 2] == 0, 1, 0]; f[n_] := a*m[n + 1] + b*m[n] + 4*Floor[(n - 1)/2] Table[f[n], {n, 1, 30}] (* A042948: (4+4k,5+4k) *) 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]]; TableForm[Table[t[i, j], {i, 1, 10}, {j, 1, 10}]] (* A191663 *) Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A191663 *)
A191655 Dispersion of (2,5,8,11,14,17,...), by antidiagonals.
1, 3, 2, 6, 4, 5, 10, 7, 9, 8, 16, 12, 15, 13, 11, 25, 19, 24, 21, 18, 14, 39, 30, 37, 33, 28, 22, 17, 60, 46, 57, 51, 43, 34, 27, 20, 91, 70, 87, 78, 66, 52, 42, 31, 23, 138, 106, 132, 118, 100, 79, 64, 48, 36, 26, 208, 160, 199, 178, 151, 120, 97, 73, 55
Offset: 1
Comments
Row 1: A152009.
For a background discussion of dispersions, see A191426.
...
Each of the sequences (3n, n>0), (3n+1, n>0), (3n+2, n>=0), generates a dispersion. Each complement (beginning with its first term >1) also generates a dispersion. The six sequences and dispersions are listed here:
...
...
EXCEPT for at most 2 initial terms (so that column 1 always starts with 1):
...
There is a formula for sequences of the type "(a or b mod m)", (as in the Mathematica program below):
If f(n)=(n mod 2), then (a,b,a,b,a,b,...) is given by
a*f(n+1)+b*f(n), so that "(a or b mod m)" is given by
a*f(n+1)+b*f(n)+m*floor((n-1)/2)), for n>=1.
Examples
Northwest corner: 1...3...6....10...16 2...4...7....12...19 5...9...15...24...37 8...13..21...33...51 11..18..28...43...66
Programs
-
Mathematica
(* Program generates the dispersion array T of the increasing sequence f[n] *) r = 40; r1 = 12; c = 40; c1 = 12; a = 3; b = 4; m[n_] := If[Mod[n, 2] == 0, 1, 0]; f[n_] := a*m[n + 1] + b*m[n] + 3*Floor[(n - 1)/2] Table[f[n], {n, 1, 30}] (* A032766: (3+5k,4+5k, k>=0) *) 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]]; TableForm[Table[t[i, j], {i,1,10}, {j,1,10}]] (* A191655 array *) Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A191655 sequence *)
A191702 Dispersion of A008587 (5,10,15,20,25,30,...), by antidiagonals.
1, 5, 2, 25, 10, 3, 125, 50, 15, 4, 625, 250, 75, 20, 6, 3125, 1250, 375, 100, 30, 7, 15625, 6250, 1875, 500, 150, 35, 8, 78125, 31250, 9375, 2500, 750, 175, 40, 9, 390625, 156250, 46875, 12500, 3750, 875, 200, 45, 11, 1953125, 781250, 234375, 62500, 18750
Offset: 1
Comments
For a background discussion of dispersions and their fractal sequences, see A191426. For dispersions of congruence sequences mod 3 or mod 4, see A191655, A191663, A191667.
...
Each of the sequences (5n, n>1), (5n+1, n>1), (5n+2, n>=0), (5n+3, n>=0), (5n+4, n>=0), generates a dispersion. Each complement (beginning with its first term >1) also generates a dispersion. The ten sequences and dispersions are listed here:
...
...
EXCEPT for at most 2 initial terms (so that column 1 always starts with 1):
...
"(a or b or c or d mod m)", used in Mathematica programs for A191707-A191711): if f(n)=(n mod 3), then
(a,b,c,d,a,b,c,d,a,b,c,d,...) is given by
a*f(n+3)+b*f(n+2)+c*f(n+1)+d*f(n), so that for n>=1,
"(a, b, c, d mod m)" is given by
a*f(n+3)+b*f(n+2)+c*f(n+1)+d*f(n)+m*floor((n-1)/4)).
Examples
Northwest corner: 1...5....25....125...625 2...10...50....250...1250 3...15...75....375...1875 4...20...100...500...2500 6...30...150...750...3750
Links
- Ivan Neretin, Table of n, a(n) for n = 1..5050 (first 100 antidiagonals, flattened)
Programs
-
Mathematica
(* Program generates the dispersion array T of the increasing sequence f[n] *) r = 40; r1 = 12; c = 40; c1 = 12; f[n_] := 5n Table[f[n], {n, 1, 30}] (* A008587 *) 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]]; TableForm[Table[t[i, j], {i, 1, 10}, {j, 1, 10}]] (* A191702 *) Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A191702 *)
Formula
T(i,j) = T(i,1)*T(1,j) = (i-1+floor((i+3)/4))*5^(j-1), i>=1, j>=1.
A191722 Dispersion of A008851, (numbers >1 and congruent to 0 or 1 mod 5), by antidiagonals.
1, 5, 2, 15, 6, 3, 40, 16, 10, 4, 101, 41, 26, 11, 7, 255, 105, 66, 30, 20, 8, 640, 265, 166, 76, 51, 21, 9, 1601, 665, 416, 191, 130, 55, 25, 12, 4005, 1665, 1041, 480, 326, 140, 65, 31, 13, 10015, 4165, 2605, 1201, 816, 351, 165, 80, 35, 14, 25040, 10415
Offset: 1
Comments
For a background discussion of dispersions and their fractal sequences, see A191426. For dispersions of congruence sequences mod 3, mod 4, or mod 5, see A191655, A191663, A191667, A191702.
...
Suppose that {2,3,4,5,6} is partitioned as {x1, x2} and {x3,x4,x5}. Let S be the increasing sequence of numbers >1 and congruent to x1 or x2 mod 5, and let T be the increasing sequence of numbers >1 and congruent to x3 or x4 or x5 mod 5. There are 10 sequences in S, each matched by a (nearly) complementary sequence in T. Each of the 20 sequences generates a dispersion, as listed here:
...
...
...
EXCEPT for at most 2 initial terms (so that column 1 always starts with 1):
...
...
Examples
Northwest corner: 1....5....15...40...101 2....6....16...41...105 3....10...26...66...166 4....11...30...76...191 7....20...51...130..326 8....21...55...140..351
Links
- Ivan Neretin, Table of n, a(n) for n = 1..5050
Programs
-
Mathematica
(* Program generates the dispersion array t of the increasing sequence f[n] *) r = 40; r1 = 12; c = 40; c1 = 12; a=5; b=6; m[n_]:=If[Mod[n,2]==0,1,0]; f[n_]:=a*m[n+1]+b*m[n]+5*Floor[(n-1)/2] Table[f[n], {n, 1, 30}] (* A008851 *) 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]]; TableForm[Table[t[i, j], {i, 1, 10}, {j, 1, 10}]] (* A191722 *) Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A191722 *)
A191723 Dispersion of A047215, (numbers >1 and congruent to 0 or 2 mod 5), by antidiagonals.
1, 2, 3, 5, 7, 4, 12, 17, 10, 6, 30, 42, 25, 15, 8, 75, 105, 62, 37, 20, 9, 187, 262, 155, 92, 50, 22, 11, 467, 655, 387, 230, 125, 55, 27, 13, 1167, 1637, 967, 575, 312, 137, 67, 32, 14, 2917, 4092, 2417, 1437, 780, 342, 167, 80, 35, 16, 7292, 10230, 6042
Offset: 1
Comments
For a background discussion of dispersions and their fractal sequences, see A191426. For dispersions of congruence sequences mod 3, mod 4, or mod 5, see A191655, A191663, A191667, A191702.
...
Suppose that {2,3,4,5,6} is partitioned as {x1, x2} and {x3,x4,x5}. Let S be the increasing sequence of numbers >1 and congruent to x1 or x2 mod 5, and let T be the increasing sequence of numbers >1 and congruent to x3 or x4 or x5 mod 5. There are 10 sequences in S, each matched by a (nearly) complementary sequence in T. Each of the 20 sequences generates a dispersion, as listed here:
...
...
...
For further information about these 20 dispersions, see A191722.
...
Examples
Northwest corner: 1....2....5....12....30 3....7....17...42....105 4....10...25...62....155 6....15...37...92....230 8....20...50...125...312 9....22...55...137...342
Links
- Ivan Neretin, Table of n, a(n) for n = 1..5050
Programs
-
Mathematica
(* Program generates the dispersion array t of the increasing sequence f[n] *) r = 40; r1 = 12; c = 40; c1 = 12; a=2; b=5; m[n_]:=If[Mod[n,2]==0,1,0]; f[n_]:=a*m[n+1]+b*m[n]+5*Floor[(n-1)/2] Table[f[n], {n, 1, 30}] (* A047215 *) 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]]; TableForm[Table[t[i, j], {i, 1, 10}, {j, 1, 10}]] (* A191722 *) Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A191722 *)
A191724 Dispersion of A047218, (numbers >1 and congruent to 0 or 3 mod 5), by antidiagonals.
1, 3, 2, 8, 5, 4, 20, 13, 10, 6, 50, 33, 25, 15, 7, 125, 83, 63, 38, 18, 9, 313, 208, 158, 95, 45, 23, 11, 783, 520, 395, 238, 113, 58, 28, 12, 1958, 1300, 988, 595, 283, 145, 70, 30, 14, 4895, 3250, 2470, 1488, 708, 363, 175, 75, 35, 16, 12238, 8125, 6175
Offset: 1
Comments
For a background discussion of dispersions and their fractal sequences, see A191426. For dispersions of congruence sequences mod 3, mod 4, or mod 5, see A191655, A191663, A191667, A191702.
...
Suppose that {2,3,4,5,6} is partitioned as {x1, x2} and {x3,x4,x5}. Let S be the increasing sequence of numbers >1 and congruent to x1 or x2 mod 5, and let T be the increasing sequence of numbers >1 and congruent to x3 or x4 or x5 mod 5. There are 10 sequences in S, each matched by a (nearly) complementary sequence in T. Each of the 20 sequences generates a dispersion, as listed here:
...
...
...
For further information about these 20 dispersions, see A191722.
...
Examples
Northwest corner: 1....3....8....20....50 2....5....13...33....83 4....10...25...63....158 6....15...38...95....238 7....18...45...113...283 9....23...58...145...363
Links
- Ivan Neretin, Table of n, a(n) for n = 1..5050
Programs
-
Mathematica
(* Program generates the dispersion array t of the increasing sequence f[n] *) r = 40; r1 = 12; c = 40; c1 = 12; a=3; b=5; m[n_]:=If[Mod[n,2]==0,1,0]; f[n_]:=a*m[n+1]+b*m[n]+5*Floor[(n-1)/2] Table[f[n], {n, 1, 30}] (* A047218 *) 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]]; TableForm[Table[t[i, j], {i, 1, 10}, {j, 1, 10}]] (* A191724 *) Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A191724 *)
Comments
Examples
References
Links
Crossrefs
Programs
Maple
Mathematica
PARI
Python
Python
Formula
Extensions