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

A270753 The least prime q > p for which n = p + q - r for some prime r, where p = A270003(n).

Original entry on oeis.org

5, 3, 3, 5, 5, 7, 7, 11, 11, 11, 11, 13, 13, 17, 17, 17, 17, 19, 19, 23, 23, 23, 23, 29, 29, 29, 29, 29, 29, 31, 31, 37, 37, 37, 37, 37, 37, 41, 41, 41, 41, 43, 43, 47, 47, 47, 47, 53, 53, 53, 53, 53, 53, 59, 59, 59, 59, 59, 59, 61, 61, 67, 67, 67, 67, 67
Offset: 1

Views

Author

Clark Kimberling, Apr 26 2016

Keywords

Examples

			n   p   q   r
1   3   5   7
2   2   3   3
3   2   3   2
4   2   5   3
5   2   5   2
6   2   7   3
7   2   7   2
		

Crossrefs

Programs

  • Mathematica
    t = Join[{{1, {3, 5, 7}}, {2, {2, 3, 3}}}, Table[If[PrimeQ[n], {n, {2, n, 2}}, p = If[EvenQ[2 + NextPrime[n, 1] - n], 3, 2]; NestWhile[# + 1 &, 1, ! PrimeQ[r = (p + (q = NextPrime[n, #])) - n] &]; {n, {p, q, r}}], {n, 3, 300}]];
    Map[#[[2]][[1]] &, t] (* p, A270003 *)
    Map[#[[2]][[2]] &, t] (* q, A270753 *)
    Map[#[[2]][[3]] &, t] (* r, A271353 *)
    (* Peter J. C. Moses, Apr 26 2016 *)

Formula

Conjecture: a(n) = A066169(n-1) for n>2. - R. J. Mathar, Jun 21 2025

A271353 The prime n - A270003(n) - A270753(n).

Original entry on oeis.org

7, 3, 2, 3, 2, 3, 2, 5, 5, 3, 2, 3, 2, 5, 5, 3, 2, 3, 2, 5, 5, 3, 2, 7, 7, 5, 5, 3, 2, 3, 2, 7, 7, 5, 5, 3, 2, 5, 5, 3, 2, 3, 2, 5, 5, 3, 2, 7, 7, 5, 5, 3, 2, 7, 7, 5, 5, 3, 2, 3, 2, 7, 7, 5, 5, 3, 2, 5, 5, 3, 2, 3, 2, 7, 7, 5, 5, 3, 2, 5, 5, 3, 2, 7, 7, 5
Offset: 1

Views

Author

Clark Kimberling, Apr 26 2016

Keywords

Examples

			n   p   q   r
1   3   5   7
2   2   3   3
3   2   3   2
4   2   5   3
5   2   5   2
6   2   7   3
7   2   7   2
		

Crossrefs

Programs

  • Mathematica
    t = Join[{{1, {3, 5, 7}}, {2, {2, 3, 3}}}, Table[If[PrimeQ[n], {n, {2, n, 2}}, p = If[EvenQ[2 + NextPrime[n, 1] - n], 3, 2]; NestWhile[# + 1 &, 1, ! PrimeQ[r = (p + (q = NextPrime[n, #])) - n] &]; {n, {p, q, r}}], {n, 3, 300}]];
    Map[#[[2]][[1]] &, t] (* p, A270003 *)
    Map[#[[2]][[2]] &, t] (* q, A270753 *)
    Map[#[[2]][[3]] &, t] (* r, A271353 *)
    (* Peter J. C. Moses, Apr 26 2016 *)

A270650 Min(i, j), where p(i)*p(j) is the n-th term of A006881.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 1, 2, 1, 3, 1, 2, 1, 2, 3, 2, 1, 1, 3, 2, 1, 4, 1, 3, 1, 2, 4, 2, 1, 3, 1, 2, 3, 1, 4, 1, 2, 2, 4, 1, 2, 1, 5, 3, 1, 3, 1, 2, 4, 1, 2, 1, 2, 3, 5, 1, 2, 1, 4, 3, 1, 5, 2, 1, 3, 4, 1, 2, 6, 1, 3, 2, 6, 2, 5, 1, 4, 1, 3, 2, 1, 1, 4, 2, 3, 1
Offset: 1

Views

Author

Clark Kimberling, Apr 25 2016

Keywords

Examples

			A006881 = (6, 10, 14, 15, 21, 22, 26, 33, 34, 35, 38, ... ), the increasing sequence of all products of distinct primes.  The first 4 factorizations are 2*3, 2*5, 2*7, 3*5, so that (a(1), a(2), a(3), a(4)) = (1,1,1,2).
		

Crossrefs

Programs

  • Mathematica
    mx = 350; t = Sort@Flatten@Table[Prime[n]*Prime[m], {n, Log[2, mx/3]}, {m, n + 1, PrimePi[mx/Prime[n]]}]; (* A006881, Robert G. Wilson v, Feb 07 2012 *)
    u = Table[FactorInteger[t[[k]]][[1]], {k, 1, Length[t]}];
    u1 = Table[u[[k]][[1]], {k, 1, Length[t]}]  (* A096916 *)
    PrimePi[u1]  (* A270650 *)
    v = Table[FactorInteger[t[[k]]][[2]], {k, 1, Length[t]}];
    v1 = Table[v[[k]][[1]], {k, 1, Length[t]}]  (* A070647 *)
    PrimePi[v1]  (* A270652 *)
    d = v1 - u1  (* A176881 *)
    Map[PrimePi[FactorInteger[#][[1, 1]]] &, Select[Range@ 240, And[SquareFreeQ@ #, PrimeOmega@ # == 2] &]] (* Michael De Vlieger, Apr 25 2016 *)

A270652 Max(i,j), where p(i)*p(j) is the n-th term of A006881.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Apr 25 2016

Keywords

Examples

			A006881 = (6, 10, 14, 15, 21, 22, 26, 33, 34, 35, 38, ... ), the increasing sequence of all products of distinct primes.  The first 4 factorizations are 2*3, 2*5, 2*7, 3*5, so that (a(1), a(2), a(3), a(4)) = (2,3,4,3).
		

Crossrefs

Programs

  • Mathematica
    mx = 350; t = Sort@Flatten@Table[Prime[n]*Prime[m], {n, Log[2, mx/3]}, {m, n + 1, PrimePi[mx/Prime[n]]}]; (* A006881, Robert G. Wilson v, Feb 07 2012 *)
    u = Table[FactorInteger[t[[k]]][[1]], {k, 1, Length[t]}];
    u1 = Table[u[[k]][[1]], {k, 1, Length[t]}]  (* A096916 *)
    PrimePi[u1]  (* A270650 *)
    v = Table[FactorInteger[t[[k]]][[2]], {k, 1, Length[t]}];
    v1 = Table[v[[k]][[1]], {k, 1, Length[t]}]  (* A070647 *)
    PrimePi[v1]  (* A270652 *)
    d = v1 - u1  (* A176881 *)
    Map[PrimePi[FactorInteger[#][[-1, 1]]] &, Select[Range@ 240, And[SquareFreeQ@ #, PrimeOmega@ # == 2] &]] (* Michael De Vlieger, Apr 25 2016 *)
  • Python
    from math import isqrt
    from sympy import primepi, primerange, primefactors
    def A270652(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return int(n+x+(t:=primepi(s:=isqrt(x)))+(t*(t-1)>>1)-sum(primepi(x//k) for k in primerange(1, s+1)))
        return primepi(max(primefactors(bisection(f,n,n)))) # Chai Wah Wu, Oct 23 2024
Showing 1-4 of 4 results.