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.

Previous Showing 11-12 of 12 results.

A282028 If n is prime then a(n) = 2n, otherwise a(n) is the smallest missing number.

Original entry on oeis.org

0, 1, 4, 6, 2, 10, 3, 14, 5, 7, 8, 22, 9, 26, 11, 12, 13, 34, 15, 38, 16, 17, 18, 46, 19, 20, 21, 23, 24, 58, 25, 62, 27, 28, 29, 30, 31, 74, 32, 33, 35, 82, 36, 86, 37, 39, 40, 94, 41, 42, 43, 44, 45, 106, 47, 48, 49, 50, 51, 118, 52, 122, 53, 54, 55, 56, 57, 134, 59, 60, 61, 142, 63, 146, 64, 65
Offset: 0

Views

Author

N. J. A. Sloane, Feb 16 2017

Keywords

Crossrefs

Programs

  • PARI
    first(n) = { my(res = vector(n), i = 1); for(x=1, n-1, if(isprime(x), res[x+1] = 2*x, if(setsearch(Set(res), i), i++); res[x+1]=i; i++)); res; } \\ Iain Fox, Nov 18 2017

Formula

If n is prime, a(n) = 2n, and these points line on the upper straight line in the graph.
If n is not a prime, after n terms we have seen all the numbers from 0 through a(n) and also the doubles of all the primes p in the range a(n)/2 < p < n.
So n = a(n) + pi(n) - pi(a(n)/2). In other words, if n is not a prime then a(n) is the unique solution to a(n) - pi(a(n)/2) = n - pi(n).
This implies that if n is not a prime, a(n) = n*(1 - 1/(2*log(n)) + o(1/log(n))).
These are the points on the lower line, which is not straight but has slope roughly equal to 1.

A384503 Lexicographically earliest infinite sequence of distinct positive integers having the property that for any pair a(n-2) = i, a(n-1) = j of consecutive terms > 1, a(n) is the smallest novel k such that gcd(i,k) > 1 if gcd(i,j) = 1 or gcd(j,k) = 1 if gcd(i,j) > 1.

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 8, 10, 7, 12, 14, 9, 16, 15, 18, 11, 20, 22, 13, 24, 26, 17, 28, 34, 19, 30, 38, 21, 32, 27, 36, 23, 33, 46, 39, 40, 42, 25, 35, 29, 45, 58, 48, 31, 44, 62, 37, 50, 74, 41, 52, 82, 43, 54, 86, 47, 56, 94, 49, 60, 63, 53, 51, 106, 57, 64, 66, 59
Offset: 1

Views

Author

David James Sycamore, May 31 2025

Keywords

Comments

Three initial terms (1,2,3) are needed since starting 1,2 would require 1 to have a prime factor.
Similar to A280985 except that if for some m, a(m) = prime p, then a(m+2) = 2*p (whereas A280985(m+1) = 2*p).
Conjectured to be a permutation of the positive integers, with primes occurring in order.

Examples

			The lexicographically earliest condition requires that the sequence starts a(n) = n for n <= 3. Then with a(2) = 2 and a(3) = 3 a(4) must be 4, the smallest novel number sharing a prime divisor with 2 (since gcd(2,3) = 1). Since gcd(3,4) = 1, a(5) must be 6, the smallest novel number sharing a prime divisor with 3. Since gcd(4,6) > 1 a(6) = 5, the smallest novel number prime to a(4) = 4. a(8) = 8 because gcd(6,5) = 1 and then a(9) = 2*5 = 10 the smallest novel number sharing a factor with 5.
		

Crossrefs

Programs

  • Mathematica
    nn = 120; c[] := False; m[] := 1; c[1] = c[2] = c[3] = True; i = 2; j = 3; u = 4;
    Range[3]~Join~Reap[Do[
      If[CoprimeQ[i, j],
        If[PrimePowerQ[i],
          p = FactorInteger[i][[1, 1]]; While[c[p*m[p]], m[p]++]; k = p*m[p],
          k = u; While[Or[c[k], CoprimeQ[i, k]], k++] ],
        k = u; While[Or[c[k], ! CoprimeQ[j, k]], k++] ];
      Sow[k]; Set[{c[k], i, j}, {True, j, k}];
    If[k == u, While[c[u], u++]], {n, 3, nn}] ][[-1, 1]] (* Michael De Vlieger, May 31 2025 *)

Formula

For prime a(n) = p, a(n+2) = 2*p. - Michael De Vlieger, May 31 2025
Previous Showing 11-12 of 12 results.