OFFSET
1
COMMENTS
The difference array, W - S, has infinitely many rows, but only 3 are distinct, specifically, the following, in which every number is a Fibonacci number:
-1, -1, -2, -3, -5, -8, ...
0, 0, 0, 0, 0, 0, 0, 0, ...
0, 1, 1, 2, 3, 5, 8, 13, ...
These are distinguished by the 2nd term in each row; that is, -1, 0, or 1, so a(n) identifies which of the 3 sequences is (row n of W) - (row n of S).
EXAMPLE
(row 2 of W) - (row 2 of S) = (4, 7, 11, 18, 29, 47, ...) - (4, 6, 10, 16, 26, 42, ...) = (0, 1, 1, 2, 3, 5, ...), so a(2) = 1.
MATHEMATICA
z = 120;
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]]];
ts = Table[A[n, k], {n, 0, z - 1}, {k, 0, z - 1}]; (* A035506, Stolarsky array *)
W[n_, k_] := Fibonacci[k + 1] Floor[n*GoldenRatio] + (n - 1) Fibonacci[k];
tw = Table[W[n, k], {n, 1, z}, {k, 1, z}]; (* A035513, Wythoff array *)
diff = tw - ts;
Table[diff[[n]][[2]], {n, 1, z}]
CROSSREFS
KEYWORD
sign
AUTHOR
Clark Kimberling, Aug 27 2025
STATUS
approved
