cp's OEIS Frontend

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.

A336008 Complement of A335999.

This page as a plain text file.
%I A336008 #29 Dec 21 2024 14:53:14
%S A336008 5,7,9,12,15,18,20,23,25,28,30,33,36,38,41,44,46,49,52,54,57,59,62,65,
%T A336008 67,70,72,75,78,80,83,85,88,91,93,96,99,101,104,106,109,112,114,117,
%U A336008 120,122,125,127,130,133,135,138,141,143,146,148,151,154,156,159
%N A336008 Complement of A335999.
%C A336008 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. See A335999 for a guide to related sequences.
%t A336008 mex[list_, start_] := (NestWhile[# + 1 &, start, MemberQ[list, #] &]);
%t A336008 {a, b} = {{1}, {}}; k = 3;
%t A336008 Do[AppendTo[b, Length[b] + k + mex[Flatten[{a, b}], Last[a]]];
%t A336008 AppendTo[a, mex[Flatten[{a, b}], Last[a]]], {150}]
%t A336008 a  (* A335999 *)
%t A336008 b  (* A336008 *)
%t A336008 (* _Peter J. C. Moses_, Jul 13 2020 *)
%Y A336008 Cf. A335999.
%K A336008 nonn
%O A336008 1,1
%A A336008 _Clark Kimberling_, Jul 16 2020
%E A336008 Corrected by _Clark Kimberling_, Sep 26 2020