# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/
Search: id:a230595
Showing 1-1 of 1
%I A230595 #27 Jul 23 2024 15:28:06
%S A230595 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,
%T A230595 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,
%U A230595 2,0,0,0,0,2,0,0,2,0,0,0,0,2,0,0,2,2,2
%N A230595 Number of ways to write n as n = x*y, where x and y are primes, 1 <= x <= n, 1 <= y <= n.
%C A230595 Dirichlet convolution of A010051(n) with itself, where A010051 = characteristic function of primes (A000040).
%C A230595 Dirichlet convolution of functions b(n) and c(n) is function a(n) = Sum_(d|n) b(d) * c(n/d).
%C A230595 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).
%H A230595 Antti Karttunen, Table of n, a(n) for n = 1..10000
%H A230595 Index entries for sequences computed from exponents in factorization of n
%F A230595 a(n) = Sum_(d|n) A010051(d) * A010051(n/d).
%F A230595 Dirichlet g.f.: primezeta(s)^2. - _Benedict W. J. Irwin_, Jul 11 2018
%e A230595 For n = 6: a(6) = Sum_(d|6) A010051(d) * A010051(6/d) = 0*0 + 1*1 + 1*1 + 1*0 = 2.
%t A230595 Table[Total@ Map[Times @@ Boole@ {PrimeQ@ #, PrimeQ[n/#]} &, FactorInteger[n][[All, 1]]], {n, 95}] (* _Michael De Vlieger_, Jul 29 2017 *)
%o A230595 (PARI) a(n)=sumdiv(n,d,isprime(d)*isprime(n/d)) \\ _Ralf Stephan_, Oct 30 2013
%o A230595 (PARI) a(n) = my(f=factor(f)); (vecsum(f[, 2])==2) * #f~ \\ _David A. Corneth_, Jul 28 2017
%o A230595 (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
%o A230595 (Python)
%o A230595 from sympy import factorint
%o A230595 def A230595(n): return 0 if sum(f:=factorint(n).values())!=2 else len(f) # _Chai Wah Wu_, Jul 23 2024
%Y A230595 Cf. A000040, A006881, A010051, A100959, A230594.
%K A230595 nonn
%O A230595 1,6
%A A230595 _Jaroslav Krizek_, Oct 27 2013
# Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE