login
Odd numbers of the form p*q where p and q are distinct primes.
92

%I #94 Sep 10 2024 14:22:23

%S 15,21,33,35,39,51,55,57,65,69,77,85,87,91,93,95,111,115,119,123,129,

%T 133,141,143,145,155,159,161,177,183,185,187,201,203,205,209,213,215,

%U 217,219,221,235,237,247,249,253,259,265,267,287,291,295,299,301,303

%N Odd numbers of the form p*q where p and q are distinct primes.

%C These are the odd squarefree semiprimes.

%C These numbers k have the property that k is a Fermat pseudoprime for at least two bases 1 < b < k - 1. That is, b^(k - 1) == 1 (mod k). See sequence A175101 for the number of bases. - _Karsten Meyer_, Dec 02 2010

%H Amiram Eldar, <a href="/A046388/b046388.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from T. D. Noe)

%F Sum_{n>=1} 1/a(n)^s = (1/2)*(P(s)^2 - P(2*s)) + 1/4^s - P(s)/2^s, for s>1, where P is the prime zeta function. - _Amiram Eldar_, Nov 21 2020

%t max = 300; A046388 = Sort@Flatten@Table[Prime[m] Prime[n], {n, 3, Ceiling[PrimePi[max/3]]}, {m, 2, n - 1}]; Select[A046388, # < max &] (* _Alonso del Arte_ based on _Robert G. Wilson v_'s program for A006881, Oct 24 2011 *)

%o (Haskell)

%o a046388 n = a046388_list !! (n-1)

%o a046388_list = filter ((== 2) . a001221) a056911_list

%o -- _Reinhard Zumkeller_, Jan 02 2014

%o (PARI) isok(n) = (n % 2) && (bigomega(n) == 2) && (omega(n)==2); \\ _Michel Marcus_, Feb 05 2015

%o (Python)

%o from sympy import factorint

%o def ok(n):

%o if n < 2 or n%2 == 0: return False

%o f = factorint(n)

%o return len(f) == 2 and sum(f.values()) == 2

%o print([k for k in range(304) if ok(k)]) # _Michael S. Branicky_, May 03 2022

%o (Python)

%o from math import isqrt

%o from sympy import primepi, primerange

%o def A046388(n):

%o if n == 1: return 15

%o def f(x): return int(n-1+x+(t:=primepi(s:=isqrt(x)))+(t*(t-1)>>1)-sum(primepi(x//k) for k in primerange(3, s+1)))

%o def bisection(f,kmin=0,kmax=1):

%o while f(kmax) > kmax: kmax <<= 1

%o while kmax-kmin > 1:

%o kmid = kmax+kmin>>1

%o if f(kmid) <= kmid:

%o kmax = kmid

%o else:

%o kmin = kmid

%o return kmax

%o return bisection(f,n,n) # _Chai Wah Wu_, Sep 10 2024

%Y Intersection of A005117 and A046315, or equally, of A005408 and A006881, or of A001358 and A056911.

%Y Union of A080774 and A190299, which the latter is the union of A131574 and A016105.

%Y Subsequence of A024556 and of A225375.

%Y Cf. A353481 (characteristic function).

%Y Cf. A001221, A046404, A056911, A175101.

%Y Different from A056913, A098905, A225375.

%K nonn

%O 1,1

%A _Patrick De Geest_, Jun 15 1998

%E I removed some ambiguity in the definition and edited the entry, merging in some material from A146166. - _N. J. A. Sloane_, May 09 2013