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
12 is a term because 12 = 5 + 7 = pi(5) * pi(7).
-
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 *)
-
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)
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
92 = 19 + 73 with pi(19) * pi(73) = 8 * 21 = 168 = sigma(92).
-
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
-
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 *)
-
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
-
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
-
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))
Showing 1-2 of 2 results.
Comments