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-3 of 3 results.

A377901 Let Q consist of 1 together with the primes (A008578); form the lexicographically earliest infinite sequence S of distinct positive numbers with the property that a(k) is in Q if and only if k is a term in S.

Original entry on oeis.org

1, 2, 3, 5, 7, 4, 11, 9, 13, 12, 17, 19, 23, 15, 29, 18, 31, 37, 41, 21, 43, 24, 47, 53, 26, 59, 28, 61, 67, 32, 71, 73, 34, 79, 36, 83, 89, 39, 97, 42, 101, 103, 107, 45, 109, 48, 113, 127, 50, 131, 52, 137, 139, 55, 149, 57, 151, 60, 157, 163, 167, 63, 173, 65
Offset: 1

Views

Author

N. J. A. Sloane, Nov 15 2024

Keywords

Comments

In the early 20th century, 1 was regarded as a prime (see A008578). The present sequence is therefore a 20th-century analog of A121053. That is, the sequence answers the question "Which terms are in Q?", and is the lexicographically earliest answer. See A121053 for further information.
Like A121053, this is an example of a "Lexicographically Earliest Sequence" for which there is a greedy algorithm: no backtracking is needed.
Theorem. Let p(k) = k-th prime, c(k) = k-th composite number. For n >= 7, if n is a prime or n = c(2*t) for some t, then a(n) = p(k) where k = floor((n+PrimePi(n)-1)/2); otherwise, n = c(2*t-1) for some t and a(n) = c(2*t).

Examples

			1 is the smallest possible choice for a(1), and 1 is in Q, and it turns out that there is no contradiction in choosing a(1) = 1.
After a(5) = 7, 4 is the smallest number not yet in the sequence, and a(4) = 5 is in Q, so we can try a(6) = 4 (and it turns out that this does not lead to a contradiction later).
		

References

  • N. J. A. Sloane, The Remarkable Sequences of Éric Angelini, MS in preparation, December 2024.

Crossrefs

Programs

  • Mathematica
    nn = 120; u = 4; v = {}; w = {}; c = 2;
    {1}~Join~Reap[Do[
      If[MemberQ[w, n], k = c;
        w = DeleteCases[w, n],
        m = Min[{c, u, v}];
        If[And[PrimeQ[m], n < m],
          AppendTo[v, n]];
          If[Length[v] > 0, If[v[[1]] == m, v = Rest[v]]]; k = m];
        AppendTo[w, k]; If[k == c, c++; While[CompositeQ[c], c++]]; Sow[k];
    If[n + 1 >= u, u++; While[PrimeQ[u], u++]], {n, 2, nn}] ][[-1, 1]] (* Michael De Vlieger, Dec 17 2024 *)

Extensions

More terms from Michael De Vlieger, Dec 17 2024

A379053 Lexicographically earliest infinite sequence of distinct positive numbers with the property that n is a member of the sequence iff a(n) is not a prime.

Original entry on oeis.org

1, 3, 4, 6, 7, 8, 9, 10, 12, 14, 13, 15, 16, 18, 20, 21, 19, 22, 24, 25, 26, 27, 28, 30, 32, 33, 34, 35, 23, 36, 37, 38, 39, 40, 42, 44, 45, 46, 48, 49, 43, 50, 51, 52, 54, 55, 53, 56, 57, 58, 60, 62, 63, 64, 65, 66, 68, 69, 61, 70, 72, 74, 75, 76, 77, 78, 71
Offset: 1

Views

Author

N. J. A. Sloane, Dec 17 2024

Keywords

Comments

The sequence tells you exactly which terms of the sequence are either 1 or composite.
See the Comments in A379051 for further information.

Crossrefs

Programs

  • Mathematica
    nn = 120; u = 3; v = {}; w = {}; c = 4;
    {1}~Join~Reap[Do[
      If[MemberQ[w, n],
        k = c; w = DeleteCases[w, n],
        m = Min[{c, u, v}]; If[And[CompositeQ[m], n < m],
          AppendTo[v, n]];
          If[Length[v] > 0,
            If[v[[1]] == m,
            v = Rest[v]]]; k = m];
        AppendTo[w, k]; If[k == c, c++; While[PrimeQ[c], c++]]; Sow[k];
    If[n + 1 >= u, u++; While[CompositeQ[u], u++]], {n, 2, nn}] ][[-1, 1]] (* Michael De Vlieger, Dec 17 2024 *)

Formula

When sorted, this appears to be the complement of [2, 5, 11, 17, 29, and prime(2*t+1), t >= 35]. - Scott R. Shannon, Dec 18 2024

Extensions

More terms from Michael De Vlieger, Dec 17 2024

A378766 Lexicographically earliest infinite sequence of distinct positive numbers with the property that n is a member of the sequence iff a(n) is powerful (in A001694).

Original entry on oeis.org

1, 3, 4, 8, 6, 9, 10, 16, 25, 27, 12, 32, 14, 36, 17, 49, 64, 19, 72, 21, 81, 23, 100, 26, 108, 121, 125, 29, 128, 31, 144, 169, 34, 196, 37, 200, 216, 39, 225, 41, 243, 43, 256, 45, 288, 47, 289, 50, 324, 343, 52, 361, 54, 392, 56, 400, 58, 432, 60, 441, 62, 484
Offset: 1

Views

Author

Michael De Vlieger, Dec 18 2024

Keywords

Comments

The sequence is a list of indices m of powerful numbers a(m).
See comments in A379051 for more information.

Examples

			a(1) = 1 since 1 is powerful, validating the appearance of 1 as an index of a powerful number in the sequence.
a(2) = 3 since self-referential 2 would prove false; 2 is not powerful, but 3 mandates a powerful number a(3).
a(3) = 4 since a(2) = 3, and 4 is the smallest powerful number that has not appeared.
a(4) = 8 since a(3) = 4, and 8 is the smallest powerful number that has not appeared.
a(5) = 6 since m = 5 has not appeared, and 6 is the smallest weak (nonpowerful, in A052485) number k > n.
a(6) = 9 since a(5) = 6, and 9 is the smallest powerful number that has not appeared, etc.
		

Crossrefs

Programs

  • Mathematica
    nn = 120;
    u = 3; v = {}; w = {}; c = 1;
    s = Rest@ Union@ Flatten@ Table[a^2*b^3, {b, Surd[#, 3]}, {a, Sqrt[#/b^3]}] &[2^30];
    rad[x_] := Times @@ FactorInteger[x][[All, 1]];
    {1}~Join~Reap[Do[
      If[MemberQ[w, n], k = s[[c]];
        w = DeleteCases[w, n],
        m = Min[{s[[c]], u, v}];
        If[And[Divisible[m, rad[m]^2], CompositeQ[m], n < m],
          AppendTo[v, n]];
          If[Length[v] > 0,
            If[v[[1]] == m, v = Rest[v] ] ]; k = m];
      AppendTo[w, k]; If[k == s[[c]], c++]; Sow[k];
        If[n + 1 >= u, u++;
          While[And[Divisible[u, rad[u]^2], CompositeQ[u]], u++] ], {n, 2, nn}] ][[-1, 1]]
Showing 1-3 of 3 results.