login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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.
4
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,2
COMMENTS
The sequence tells you exactly which terms of the sequence are either 1 or composite.
See the Comments in A379051 for further information.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..65536 [Terms 1 to 10000 from Scott R. Shannon]
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
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 *)
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Dec 17 2024
EXTENSIONS
More terms from Michael De Vlieger, Dec 17 2024
STATUS
approved