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

A272861 Sum of two integers when equal to the product of their prime-counting functions.

Original entry on oeis.org

12, 16, 18, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 116, 120, 280, 310, 325, 330, 942, 948, 954, 960, 966, 972, 984, 990, 996, 2968, 3003, 8224, 8232, 8240, 8248, 8280, 8288, 8304, 8312, 8360, 8408, 23499, 23508, 23589
Offset: 1

Views

Author

Giuseppe Coppoletta, Jun 18 2016

Keywords

Comments

The sums are listed in increasing order. The only term with equal addends is a(2)= 16 = 8 + 8 = pi(8)^2, Indeed j=8 is the only solution to pi(j)^2 = 2*j, which is easily seen using pi(j) > j/log(j) for j>16.

Examples

			32 is a term because 32 = 10 + 22 = 4 * 8 = pi(10) * pi(22).
		

Crossrefs

Programs

  • Mathematica
    nn = 10^3; Select[Range@ nn, Function[k, IntegerQ@ SelectFirst[Range@ nn, k == PrimePi[#] PrimePi[k - #] &]]] (* Version 10, or *)
    Select[Range[10^3], Function[n, Length@ Select[Transpose@ {#, n - #} &@ Range[Floor[n/2]], n == PrimePi[First@ #] PrimePi[Last@ #] &] > 0]] (* Michael De Vlieger, Jun 30 2016 *)
  • Sage
    def g(n): return [k for k in (3..n/2) if n==prime_pi(k)*prime_pi(n-k)]
    [n for n in range(2,1000) if len(g(n))>0]

Formula

Positive integers n such that n = pi(j) * pi(n-j) for some j.

Extensions

a(50)-a(53) from Giovanni Resta, Jun 29 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]) #
    

A273286 Positive integers n such that n=p+q for some primes p,q with pi(p)*pi(q) = sigma(n).

Original entry on oeis.org

92, 130, 132, 136, 154, 270, 286, 384, 398, 456, 546, 608, 630, 636, 702, 934, 944, 2730, 4394, 4470, 4556, 5544, 12084, 14320, 17572, 22632, 27808, 27930, 31150, 31284, 32534, 36346, 41004, 41544, 42274, 56916, 58552, 61680, 66654, 74826, 86200
Offset: 1

Views

Author

Giuseppe Coppoletta, Jun 20 2016

Keywords

Comments

Equivalently, integers n such that sigma(n) = i*j for some i,j with prime(i)+prime(j) = n. Each term is necessarily even, otherwise if n is odd n=2+q < sigma(2+q) = pi(2)*pi(q) = pi(q) < q which is absurd. Also p and q cannot be equal, otherwise sigma(2*p) = 3*(p+1) = pi(p)^2 with no solution.
Conjecture: the sequence is infinite and each term has only one decomposition into a sum of suitable primes p,q.
Using Rosser's theorem we can show that the primes p,q >= 19 and each of them can only occur for a finite number of terms n. - Robert Israel, Jun 30 2016

Examples

			92 = 19 + 73 with pi(19) * pi(73) = 8 * 21 = 168 = sigma(92).
		

Crossrefs

Programs

  • Maple
    N:= 10^6: # to use primes up to N
    Primes:= select(isprime, [2,seq(i,i=3..N,2)]):
    filter:= proc(n) local s,i,j;
      s:= numtheory:-sigma(n);
      for i in select(`>=`,numtheory:-divisors(s), ceil(sqrt(s))) minus {s} do
         if i > nops(Primes) then return FAIL
         elif Primes[i] + Primes[s/i] = n then return true fi
      od:
      false
    end proc:
    A:= NULL:
    for n from 2 by 2 do
      v:= filter(n);
      if v = FAIL then break
      elif v then A:= A, n
      fi
    od:
    A; # Robert Israel, Jun 30 2016
  • Mathematica
    Select[Range[10^3], Function[n, Length@ Select[Transpose@ {#, n - #} &@ Range[Floor[n/2]], And[Times @@ Boole@ PrimeQ@ {First@ #, Last@ #} == 1, DivisorSigma[1, First@ # + Last@ #] == PrimePi[First@ #] PrimePi[Last@ #]] &] > 0]] (* Michael De Vlieger, Jun 30 2016 *)
  • PARI
    is(n) = if(n%2==1, return(0), my(x=n-1, y=1); while(x > y, if(ispseudoprime(x) && ispseudoprime(y) && sigma(x+y)==primepi(x)*primepi(y), return(1)); x--; y++); return(0)) \\ Felix Fröhlich, Jun 28 2016
    
  • PARI
    is(n) = my( d=divisors(sigma(n))); for(i=1,ceil(#d/2), if(prime(d[i]) + prime(d[#d + 1-i]) == n, return(1))); return(0) \\ David A. Corneth, Jun 30 2016
  • Sage
    def sol(n): return [j for j in divisors(sigma(n)) if j^2<= sigma(n) and is_prime(n-nth_prime(j)) and j * prime_pi(n-nth_prime(j))==sigma(n)]
    v=[n for n in range(2,100000,2) if sol(n)]
    print('list_n =',v)
    w=[sigma(n) for n in v]; print('list_sigma(n) =',w)
    list_pi(p)=flatten([sol(n) for n in range(2,100000,2) if sol(n)])
    print('list_pi(p) =',list_pi(p))
    list_pi(q)=[w[n]/list_pi[n] for n in range(len(v))]
    print('list_pi(q) =',list_pi(q))
    

Formula

Integers n such that sigma(n) = pi(q) * pi(n-q) for some prime q.
Showing 1-3 of 3 results.