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

A272860 Sums of two primes (in increasing order) when equal to the product of their prime-counting functions.

Original entry on oeis.org

12, 18, 24, 96, 116, 120, 984, 990, 996, 8408, 23616, 23742, 23850, 24030, 24066, 24084, 480324, 480336, 481344, 3523814, 3523842, 3523884, 3524514, 9557160, 9558030, 9558240, 9558300, 25874592, 25874640, 70119798, 189960894, 189961344, 189962352, 189963594, 189963630, 189969102
Offset: 1

Views

Author

Giuseppe Coppoletta, Jun 19 2016

Keywords

Comments

Each term is necessarily even and 3 < p < q in the formula n = p+q = pi(p)*pi(q). Indeed, assuming p<=q, if p=2 then n = 2+q = pi(2)*pi(q) = pi(q) < q. Inequality p > 3 easily follows from prime(k) > k*log(k) and if p=q then 2*p = pi(p)^2 with no solution.
Primes p,q can only occur for a finite number of terms n (see comments in A273286).
Conjecture: the sequence is infinite and each term has only one decomposition into a sum of suitable primes p,q.
From David A. Corneth, Jun 28 2016: (Start)
Pi(p) and pi(q) seem dependent on each other. Below is a small list of pi(p), the least corresponding pi(q) and the largest corresponding pi(q). If a value of pi(p) isn't listed, no terms are formed with it.
3, 4, 8
4, 24, 30
6, 164, 166
8, 1051, 1051
9, 2624, 2676
12, 40027, 40112
Can these bounds on pi(q) be expressed in terms of pi(p)? (End)

Examples

			12 is a term because 12 = 5 + 7 = pi(5) * pi(7).
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^3], Function[n, MemberQ[Times @@ # & /@ PrimePi@ Select[Transpose@ {#, n - #} &@ Range[Floor[n/2]], Times @@ Boole@ PrimeQ@ {First@ #, Last@ #} == 1 &], n]]] (* Michael De Vlieger, Jun 29 2016 *)
  • Sage
    def sol(n):
        return [k for k in divisors(n) if k^2<= n and is_prime(n-nth_prime(k)) and k*prime_pi(n-nth_prime(k))==n]
    N=25000
    v=[n for n in range(2,N,2) if len(sol(n))>0]
    print('A272862 =',v)
    list_pi=flatten([sol(n) for n in range(2,N,2) if sol(n)])
    print('list_pi(p) =',list_pi)

Formula

Numbers n = p+q = pi(p)*pi(q) for some primes p and q.
Equivalently, n = i*j = prime(i) + prime(j) for some i,j.
A272862 gives the corresponding terms pi(q) (with q>p). The terms pi(p) are given by A272860 / A272862

Extensions

More terms from David A. Corneth, Jun 28 2016

A272862 Positive integers j such that prime(i) + prime(j) = i*j for some i <= j.

Original entry on oeis.org

4, 6, 8, 24, 29, 30, 164, 165, 166, 1051, 2624, 2638, 2650, 2670, 2674, 2676, 40027, 40028, 40112, 251701, 251703, 251706, 251751, 637144, 637202, 637216, 637220, 1617162, 1617165, 4124694, 10553383, 10553408, 10553464, 10553533, 10553535, 10553839, 69709686
Offset: 1

Views

Author

Giuseppe Coppoletta, Jul 25 2016

Keywords

Comments

Also pi(q) for primes q verifying p+q = pi(p)*pi(q) for some prime p <= q.
The list of products i*j gives A272860. See also comments there.

Examples

			8 is a term as prime(3) + prime(8) = 3*8.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[3000], Function[j, Total@ Boole@ Map[Prime@ # + Prime@ j == # j &, Range@ j] > 0]] (* Michael De Vlieger, Jul 28 2016 *)
  • PARI
    is(n) = for(i=1, n, if(prime(i)+prime(n)==i*n, return(1))); return(0) \\ Felix Fröhlich, Jul 27 2016
    
  • PARI
    is(n,p=prime(n))=my(i); forprime(q=2,p, if(i++*n==p+q, return(1))); 0
    v=List(); n=0; forprime(p=2,1e6, if(is(n++,p), listput(v,n))); Vec(v) \\ Charles R Greathouse IV, Jul 28 2016
  • Sage
    def sol(n):
        if n<5: a=n
        else: a=exp(n+1)/(n+1)
        b=(n-1)/n^2*exp(n^2/(n-1.1))
        return [j for j in range(a,b) if is_prime(n*j-nth_prime(n)) and prime_pi(n*j-nth_prime(n))==j]
    flatten([sol(i) for i in (1..15) if len(sol(i))>0]) #
    
Showing 1-2 of 2 results.