login
A392117
Lower Wythoff partition sequence of the primes; see Comments.
9
2, 3, 11, 13, 19, 29, 37, 41, 47, 53, 67, 73, 79, 89, 97, 103, 107, 109, 131, 139, 151, 163, 179, 181, 191, 193, 197, 223, 229, 233, 239, 241, 257, 269, 277, 281, 283, 313, 317, 337, 353, 359, 379, 383, 389, 401, 419, 421, 439, 449, 457, 461, 463, 467, 491
OFFSET
1,1
COMMENTS
Let s = (s(n)) be an increasing sequence of positive integers, and define sequences u = (u(n)) and v = (v(n)) as follows:
u(1) = s(1);
v(1) = least term of s that is >= u(1) + s(1);
u(n) = least term of s that is not in {u(k) : k < n} and not in {v(k) : k < n};
v(n) = least unused term of s that is greater than u(n) + s(n), for n >= 1.
Then u is the lower Wythoff partition sequence of s, and v is the upper Wythoff partition sequence of s.
If s = A000027, then u = A000201 and v = A001950, these being the classical lower and upper Wythoff sequences.
MATHEMATICA
w[s_List] := Module[{u = {}, v = {}, used = <||>, n = 1, i = 1, target, vt},
While[i <= Length@s, While[i <= Length@s && KeyExistsQ[used, i], i++];
If[i > Length@s, Break[]]; AppendTo[u, s[[i]]]; used[i] = True;
target = u[[-1]] + s[[n]]; vt = -1; Do[If[! KeyExistsQ[used, j] && s[[j]] >= target, vt = j; Break[]], {j, 1, Length@s}]; If[vt == -1, u = Drop[u, -1]; Break[], AppendTo[v, s[[vt]]]; used[vt] = True; n++]; ]; {u, v}]
s = Prime[Range[200]]; (* User: put your increasing sequence s here *)
u = First[w[s]] (* lower Wythoff partition sequence of s *)
v = Last[w[s]] (* upper Wythoff partition sequence of s *)
(* Peter J. C. Moses, Dec 23 2025 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Jan 19 2026
STATUS
approved