A191432 Dispersion of ([n*x+1/x]), where x=sqrt(2) and [ ]=floor, by antidiagonals.
1, 2, 5, 3, 7, 8, 4, 10, 12, 11, 6, 14, 17, 16, 15, 9, 20, 24, 23, 21, 18, 13, 28, 34, 33, 30, 26, 22, 19, 40, 48, 47, 43, 37, 31, 25, 27, 57, 68, 67, 61, 53, 44, 36, 29, 38, 81, 96, 95, 86, 75, 62, 51, 41, 32, 54, 115, 136, 135, 122, 106, 88, 72, 58, 45, 35, 77, 163, 193, 191, 173, 150, 125, 102, 82, 64, 50, 39
Offset: 1
Examples
Northwest corner: 1 2 3 4 6 9 5 7 10 14 20 28 8 12 17 24 34 48 11 16 23 33 47 67 15 21 30 43 61 86
Links
- Michel Marcus, Antidiagonals n = 1..100, flattened
Programs
-
Mathematica
(* Program generates the dispersion array T 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 = Sqrt[2]; f[n_] := Floor[n*x + 1/x] (* 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}]] (* A191432 array *) Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A191432 sequence *) (* Program by Peter J. C. Moses, Jun 01 2011 *)
-
PARI
s(n) = my(x=quadgen(8)); floor(n*x+1/x); \\ A001953 t(n) = floor((n+1/2)*(2+quadgen(8))); \\ A001954 T(n, k) = my(x = t(n-1)); for (i=2, k, x = s(x);); x; \\ Michel Marcus, Jul 13 2022
Comments