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.

Showing 1-2 of 2 results.

A336008 Complement of A335999.

Original entry on oeis.org

5, 7, 9, 12, 15, 18, 20, 23, 25, 28, 30, 33, 36, 38, 41, 44, 46, 49, 52, 54, 57, 59, 62, 65, 67, 70, 72, 75, 78, 80, 83, 85, 88, 91, 93, 96, 99, 101, 104, 106, 109, 112, 114, 117, 120, 122, 125, 127, 130, 133, 135, 138, 141, 143, 146, 148, 151, 154, 156, 159
Offset: 1

Views

Author

Clark Kimberling, Jul 16 2020

Keywords

Comments

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.

Crossrefs

Cf. A335999.

Programs

  • Mathematica
    mex[list_, start_] := (NestWhile[# + 1 &, start, MemberQ[list, #] &]);
    {a, b} = {{1}, {}}; k = 3;
    Do[AppendTo[b, Length[b] + k + mex[Flatten[{a, b}], Last[a]]];
    AppendTo[a, mex[Flatten[{a, b}], Last[a]]], {150}]
    a  (* A335999 *)
    b  (* A336008 *)
    (* Peter J. C. Moses, Jul 13 2020 *)

Extensions

Corrected by Clark Kimberling, Sep 26 2020

A384773 a(1) = 1, a(2) = 1. For n > 2 if a(n-1) = k is a novel term, a(n) = a(n-1-k). Otherwise if a(n-1) is a repeat term a(n) = number of m; 1 <= m <= n-2 such that a(m) = a(n-1).

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 4, 2, 1, 5, 3, 1, 6, 4, 1, 7, 1, 8, 5, 1, 9, 1, 10, 6, 1, 11, 1, 12, 7, 1, 13, 8, 1, 14, 1, 15, 9, 1, 16, 10, 1, 17, 1, 18, 11, 1, 19, 12, 1, 20, 1, 21, 13, 1, 22, 1, 23, 14, 1, 24, 15, 1, 25, 1, 26, 16, 1, 27, 1, 28, 17, 1, 29, 18, 1, 30
Offset: 1

Views

Author

David James Sycamore, Jun 09 2025

Keywords

Comments

a(n) <= n for all n, with equality for n = 1. Same as A364749 until a(12).
The sequence of indices of terms a(n-1-k) following novel terms k (starting: 2,3,4,6,8,10,11,13,...) appears to be A335999.
Records subsequence is A000027, with records occurring at indices 1, A026278.

Examples

			a(1) = a(2) = 1 implies a(3) = 1 since 1 has been repeated once. Then a(4) = 2 because now 1 has been repeated twice. Since 2 is a novel term a(5) = a(4-2) = a(2) = 1. Since 1 has been repeated three times a(6) = 3, another novel term so a(7) = a(6-3) = a(3) = 1.
		

Crossrefs

Programs

Showing 1-2 of 2 results.