login
A230595
Number of ways to write n as n = x*y, where x and y are primes, 1 <= x <= n, 1 <= y <= n.
8
0, 0, 0, 1, 0, 2, 0, 0, 1, 2, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 2, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 2, 0, 0, 0, 2, 0, 2, 2, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 2, 2
OFFSET
1,6
COMMENTS
Dirichlet convolution of A010051(n) with itself, where A010051 = characteristic function of primes (A000040).
Dirichlet convolution of functions b(n) and c(n) is function a(n) = Sum_(d|n) b(d) * c(n/d).
a(n) = 0, 1 or 2. a(n) = 0 for numbers n from A100959 (non-semiprimes); a(n) = 1 for n = p^2, p = prime; a(n) = 2 for numbers n from A006881 (product of two distinct primes).
FORMULA
a(n) = Sum_(d|n) A010051(d) * A010051(n/d).
Dirichlet g.f.: primezeta(s)^2. - Benedict W. J. Irwin, Jul 11 2018
EXAMPLE
For n = 6: a(6) = Sum_(d|6) A010051(d) * A010051(6/d) = 0*0 + 1*1 + 1*1 + 1*0 = 2.
MATHEMATICA
Table[Total@ Map[Times @@ Boole@ {PrimeQ@ #, PrimeQ[n/#]} &, FactorInteger[n][[All, 1]]], {n, 95}] (* Michael De Vlieger, Jul 29 2017 *)
PROG
(PARI) a(n)=sumdiv(n, d, isprime(d)*isprime(n/d)) \\ Ralf Stephan, Oct 30 2013
(PARI) a(n) = my(f=factor(f)); (vecsum(f[, 2])==2) * #f~ \\ David A. Corneth, Jul 28 2017
(PARI) first(n) = my(v = vector(n)); forprime(p = 2, sqrtint(n), v[p^2] = 1; forprime(q = p + 1, n \ p, v[p*q] = 2)); v \\ David A. Corneth, Jul 28 2017
(Python)
from sympy import factorint
def A230595(n): return 0 if sum(f:=factorint(n).values())!=2 else len(f) # Chai Wah Wu, Jul 23 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Jaroslav Krizek, Oct 27 2013
STATUS
approved