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.

A357713 a(0) = 2; afterwards a(n) is the least prime greater than a(n-1) such that Omega(a(n-1) + a(n)) = n.

Original entry on oeis.org

2, 3, 7, 11, 13, 19, 197, 251, 389, 1531, 2053, 3067, 17669, 25339, 66821, 105211, 140549, 318203, 1008901, 1940219, 6710533, 9804539, 12215557, 34970363, 49964293, 75864827, 276456709, 864393979, 1350198533, 2877659899, 4101661957, 7709498107, 16449692933, 51196041979
Offset: 0

Views

Author

Zak Seidov, Oct 10 2022

Keywords

Examples

			2 + 3 = 5 (prime), 3 + 7 = 10 (semiprime), 7 + 11 = 18 (triprime).
		

Crossrefs

Cf. A001222 (Omega).

Programs

  • Maple
    f:= proc(n, a) # first prime b>a such that a+b is an n-almost-prime
      uses priqueue;
      local Aprimes, v, M, q, w;
      M:= 10^100;
      initialize(Aprimes);
      insert([-2^n, 0, 2], Aprimes);
      do
        v:= extract(Aprimes);
        if v[2] = n then
          if -v[1] > 2*a and isprime(-v[1]-a) then return -v[1]-a fi
        else
          insert(v+[0, 1, 0], Aprimes);
          q:= nextprime(v[3]);
          w:= v[1]*(q/v[3])^(n-v[2]);
          if w >= -M then insert([w, v[2], q], Aprimes) fi
        fi
      od
    end proc:
    R:= 2: a:= 2:
    for n from 1 to 30 do
      a:= f(n,a);
      R:= R,a;
    od:
    R; # Robert Israel, Sep 19 2023
  • Mathematica
    s = {p = 2}; Do[q = NextPrime[p]; While[k != PrimeOmega[p + q], q = NextPrime[q]]; AppendTo[s, p = q], {k, 30}]; s