This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A335999 #23 Dec 21 2024 14:53:03 %S A335999 1,2,3,4,6,8,10,11,13,14,16,17,19,21,22,24,26,27,29,31,32,34,35,37,39, %T A335999 40,42,43,45,47,48,50,51,53,55,56,58,60,61,63,64,66,68,69,71,73,74,76, %U A335999 77,79,81,82,84,86,87,89,90,92,94,95,97,98,100,102,103 %N A335999 a(1) = 1; for n >= 2, a(n) = least positive integer not in {a(1),..., a(n-1), b(1),...,b(n-1)}, where for n >=1, b(n) = n + 2 + least positive integer not in {a(1),..., a(n-1), a(n), b(1),...,b(n-1)}. %C A335999 In general, let u(1) = 1, and let k be a positive integer. Define u(n) = least positive integer not in {u(1),..., u(n-1), v(1),...,v(n-1)} and v(n) = n - 1 + k + least positive integer not in {u(1),..., u(n-1), u(n), v(1),...,v(n-1)}. As sets, (u(n)) and (v(n)) are disjoint. If k >= -1, let a(n) = u(n) and b(n) = v(n) for all n >= 1, but if k <= -2, let a(n) = u(n) - k + 1 and b(n) = v(n) - k - 1 for all n >= 1. Then every positive integer is in exactly one of the sequences (a(n)) and (b(n)). The difference sequence of (a(n)) consists of 1's and 2's; the difference sequence of (b(n)) consists of 2's and 3's. %C A335999 **** %C A335999 Guide to related sequences: %C A335999 k sequences (a(n)) and (b(n)) %C A335999 0 A000201 and A001950 (lower and upper Wythoff sequences) %C A335999 1 A026351 and A026352 %C A335999 2 A022342 and A003622 %C A335999 3 A335999 and A336008 %e A335999 a(1) = 1; b(1) = 1+2+2 = 5 %e A335999 a(2) = 2; b(2) = 2+2+3 = 7 %e A335999 a(3) = 3; b(3) = 3+2+4 = 9 %e A335999 a(4) = 4; b(4) = 4+2+6 = 12 %t A335999 mex[list_, start_] := (NestWhile[# + 1 &, start, MemberQ[list, #] &]); %t A335999 {a, b} = {{1}, {}}; k = 3; %t A335999 Do[AppendTo[b, Length[b] + k + mex[Flatten[{a, b}], Last[a]]]; %t A335999 AppendTo[a, mex[Flatten[{a, b}], Last[a]]], {150}] %t A335999 a (* A335999 *) %t A335999 b (* A336008 *) %t A335999 (* _Peter J. C. Moses_, Jul 13 2020 *) %Y A335999 Cf. A336008. %K A335999 nonn %O A335999 1,2 %A A335999 _Clark Kimberling_, Jul 16 2020