OFFSET
1,1
COMMENTS
These are the odd squarefree semiprimes.
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
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..1000 from T. D. Noe)
FORMULA
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
MATHEMATICA
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 *)
PROG
(Haskell)
a046388 n = a046388_list !! (n-1)
a046388_list = filter ((== 2) . a001221) a056911_list
-- Reinhard Zumkeller, Jan 02 2014
(PARI) isok(n) = (n % 2) && (bigomega(n) == 2) && (omega(n)==2); \\ Michel Marcus, Feb 05 2015
(Python)
from sympy import factorint
def ok(n):
if n < 2 or n%2 == 0: return False
f = factorint(n)
return len(f) == 2 and sum(f.values()) == 2
print([k for k in range(304) if ok(k)]) # Michael S. Branicky, May 03 2022
(Python)
from math import isqrt
from sympy import primepi, primerange
def A046388(n):
if n == 1: return 15
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)))
def bisection(f, kmin=0, kmax=1):
while f(kmax) > kmax: kmax <<= 1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if f(kmid) <= kmid:
kmax = kmid
else:
kmin = kmid
return kmax
return bisection(f, n, n) # Chai Wah Wu, Sep 10 2024
CROSSREFS
Cf. A353481 (characteristic function).
KEYWORD
nonn
AUTHOR
Patrick De Geest, Jun 15 1998
EXTENSIONS
I removed some ambiguity in the definition and edited the entry, merging in some material from A146166. - N. J. A. Sloane, May 09 2013
STATUS
approved