login
Lower Wythoff partition sequence of the primes; see Comments.
9

%I #18 Feb 15 2026 13:04:53

%S 2,3,11,13,19,29,37,41,47,53,67,73,79,89,97,103,107,109,131,139,151,

%T 163,179,181,191,193,197,223,229,233,239,241,257,269,277,281,283,313,

%U 317,337,353,359,379,383,389,401,419,421,439,449,457,461,463,467,491

%N Lower Wythoff partition sequence of the primes; see Comments.

%C Let s = (s(n)) be an increasing sequence of positive integers, and define sequences u = (u(n)) and v = (v(n)) as follows:

%C u(1) = s(1);

%C v(1) = least term of s that is >= u(1) + s(1);

%C u(n) = least term of s that is not in {u(k) : k < n} and not in {v(k) : k < n};

%C v(n) = least unused term of s that is greater than u(n) + s(n), for n >= 1.

%C Then u is the lower Wythoff partition sequence of s, and v is the upper Wythoff partition sequence of s.

%C If s = A000027, then u = A000201 and v = A001950, these being the classical lower and upper Wythoff sequences.

%t w[s_List] := Module[{u = {}, v = {}, used = <||>, n = 1, i = 1, target, vt},

%t While[i <= Length@s, While[i <= Length@s && KeyExistsQ[used, i], i++];

%t If[i > Length@s, Break[]]; AppendTo[u, s[[i]]]; used[i] = True;

%t 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}]

%t s = Prime[Range[200]]; (* User: put your increasing sequence s here *)

%t u = First[w[s]] (* lower Wythoff partition sequence of s *)

%t v = Last[w[s]] (* upper Wythoff partition sequence of s *)

%t (* _Peter J. C. Moses_, Dec 23 2025 *)

%Y Cf. A000040, A000201, A001950, A392118, A392119, A392121.

%K nonn

%O 1,1

%A _Clark Kimberling_, Jan 19 2026