%I M4082 #242 Aug 18 2024 10:04:47
%S 6,10,14,15,21,22,26,33,34,35,38,39,46,51,55,57,58,62,65,69,74,77,82,
%T 85,86,87,91,93,94,95,106,111,115,118,119,122,123,129,133,134,141,142,
%U 143,145,146,155,158,159,161,166,177,178,183,185,187,194,201,202,203,205
%N Squarefree semiprimes: Numbers that are the product of two distinct primes.
%C Numbers k such that phi(k) + sigma(k) = 2*(k+1). - _Benoit Cloitre_, Mar 02 2002
%C Numbers k such that tau(k) = omega(k)^omega(k). - _Benoit Cloitre_, Sep 10 2002 [This comment is false. If k = 900 then tau(k) = omega(k)^omega(k) = 27 but 900 = (2*3*5)^2 is not the product of two distinct primes. - _Peter Luschny_, Jul 12 2023]
%C Could also be called 2-almost primes. - _Rick L. Shepherd_, May 11 2003
%C From the Goldston et al. reference's abstract: "lim inf [as n approaches infinity] [(a(n+1) - a(n))] <= 26. If an appropriate generalization of the Elliott-Halberstam Conjecture is true, then the above bound can be improved to 6." - _Jonathan Vos Post_, Jun 20 2005
%C The maximal number of consecutive integers in this sequence is 3 - there cannot be 4 consecutive integers because one of them would be divisible by 4 and therefore would not be product of distinct primes. There are several examples of 3 consecutive integers in this sequence. The first one is 33 = 3 * 11, 34 = 2 * 17, 35 = 5 * 7; (see A039833). - Matias Saucedo (solomatias(AT)yahoo.com.ar), Mar 15 2008
%C Number of terms less than or equal to 10^k for k >= 0 is A036351(k). - _Robert G. Wilson v_, Jun 26 2012
%C Are these the numbers k whose difference between the sum of proper divisors of k and the arithmetic derivative of k is equal to 1? - _Omar E. Pol_, Dec 19 2012
%C Intersection of A001358 and A030513. - _Wesley Ivan Hurt_, Sep 09 2013
%C A237114(n) (smallest semiprime k^prime(n)+1) is a term, for n != 2. - _Jonathan Sondow_, Feb 06 2014
%C a(n) are the reduced denominators of p_2/p_1 + p_4/p_3, where p_1 != p_2, p_3 != p_4, p_1 != p_3, and the p's are primes. In other words, (p_2*p_3 + p_1*p_4) never shares a common factor with p_1*p_3. - _Richard R. Forberg_, Mar 04 2015
%C Conjecture: The sums of two elements of a(n) forms a set that includes all primes greater than or equal to 29 and all integers greater than or equal to 83 (and many below 83). - _Richard R. Forberg_, Mar 04 2015
%C The (disjoint) union of this sequence and A001248 is A001358. - _Jason Kimberley_, Nov 12 2015
%C A263990 lists the subsequence of a(n) where a(n+1)=1+a(n). - _R. J. Mathar_, Aug 13 2019
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%D Zervos, Marie: Sur une classe de nombres composés. Actes du Congrès interbalkanique de mathématiciens 267-268 (1935)
%H T. D. Noe, <a href="/A006881/b006881.txt">Table of n, a(n) for n = 1..10000</a>
%H D. A. Goldston, S. W. Graham, J. Pimtz and Y. Yildirim, <a href="http://arxiv.org/abs/math/0506067">"Small Gaps Between Primes or Almost Primes"</a>, arXiv:math/0506067 [math.NT], March 2005.
%H G. T. Leavens and M. Vermeulen, <a href="/A006877/a006877_1.pdf">3x+1 search programs</a>, Computers and Mathematics with Applications, 24 (1992), 79-99. (Annotated scanned copy)
%H R. J. Mathar, <a href="https://arxiv.org/abs/0803.0900">Series of reciprocal powers of k-almost primes</a> arXiv:0803.0900, table 6 k=2 shows sum 1/a(n)^s.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Semiprime.html">Semiprime</a>
%H <a href="/index/Pri#prime_signature">Index to sequences related to prime signature</a>
%F A000005(a(n)^(k-1)) = A000290(k) for all k>0. - _Reinhard Zumkeller_, Mar 04 2007
%F A109810(a(n)) = 4; A178254(a(n)) = 6. - _Reinhard Zumkeller_, May 24 2010
%F A056595(a(n)) = 3. - _Reinhard Zumkeller_, Aug 15 2011
%F a(n) = A096916(n) * A070647(n). - _Reinhard Zumkeller_, Sep 23 2011
%F A211110(a(n)) = 3. - _Reinhard Zumkeller_, Apr 02 2012
%F Sum_{n >= 1} 1/a(n)^s = (1/2)*(P(s)^2 - P(2*s)), where P is Prime Zeta. - _Enrique Pérez Herrero_, Jun 24 2012
%F A050326(a(n)) = 2. - _Reinhard Zumkeller_, May 03 2013
%F sopf(a(n)) = a(n) - phi(a(n)) + 1 = sigma(a(n)) - a(n) - 1. - _Wesley Ivan Hurt_, May 18 2013
%F d(a(n)) = 4. Omega(a(n)) = 2. omega(a(n)) = 2. mu(a(n)) = 1. - _Wesley Ivan Hurt_, Jun 28 2013
%F a(n) ~ n log n/log log n. - _Charles R Greathouse IV_, Aug 22 2013
%F A089233(a(n)) = 1. - _Reinhard Zumkeller_, Sep 04 2013
%F From _Peter Luschny_, Jul 12 2023: (Start)
%F For k > 1: k is term of a <=> k^A001221(k) = k*A007947(k).
%F For k > 1: k is term of a <=> k^A001222(k) = k*A007947(k).
%F For k > 1: k is term of a <=> A363923(k) = k. (End)
%p N:= 1001: # to get all terms < N
%p Primes:= select(isprime, [2,seq(2*k+1,k=1..floor(N/2))]):
%p {seq(seq(p*q,q=Primes[1..ListTools:-BinaryPlace(Primes,N/p)]),p=Primes)} minus {seq(p^2,p=Primes)};
%p # _Robert Israel_, Jul 23 2014
%p # Alternative, using A001221:
%p isA006881 := proc(n)
%p if numtheory[bigomega](n) =2 and A001221(n) = 2 then
%p true ;
%p else
%p false ;
%p end if;
%p end proc:
%p A006881 := proc(n) if n = 1 then 6; else for a from procname(n-1)+1 do if isA006881(a) then return a; end if; end do: end if;
%p end proc: # _R. J. Mathar_, May 02 2010
%p # Alternative:
%p with(NumberTheory): isA006881 := n -> is(NumberOfPrimeFactors(n, 'distinct') = 2 and NumberOfPrimeFactors(n) = 2):
%p select(isA006881, [seq(1..205)]); # _Peter Luschny_, Jul 12 2023
%t mx = 205; Sort@ Flatten@ Table[ Prime[n]*Prime[m], {n, Log[2, mx/3]}, {m, n + 1, PrimePi[ mx/Prime[n]]}] (* _Robert G. Wilson v_, Dec 28 2005, modified Jul 23 2014 *)
%t sqFrSemiPrimeQ[n_] := Last@# & /@ FactorInteger@ n == {1, 1}; Select[Range[210], sqFrSemiPrimeQ] (* _Robert G. Wilson v_, Feb 07 2012 *)
%t With[{upto=250},Select[Sort[Times@@@Subsets[Prime[Range[upto/2]],{2}]],#<=upto&]] (* _Harvey P. Dale_, Apr 30 2018 *)
%o (PARI) for(n=1,214,if(bigomega(n)==2&&omega(n)==2,print1(n,",")))
%o (PARI) for(n=1,214,if(bigomega(n)==2&&issquarefree(n),print1(n,",")))
%o (PARI) list(lim)=my(v=List()); forprime(p=2,sqrt(lim), forprime(q=p+1, lim\p, listput(v,p*q))); vecsort(Vec(v)) \\ _Charles R Greathouse IV_, Jul 20 2011
%o (Haskell)
%o a006881 n = a006881_list !! (n-1)
%o a006881_list = filter chi [1..] where
%o chi n = p /= q && a010051 q == 1 where
%o p = a020639 n
%o q = n `div` p
%o -- _Reinhard Zumkeller_, Aug 07 2011
%o (Sage)
%o def A006881_list(n) :
%o R = []
%o for i in (6..n) :
%o d = prime_divisors(i)
%o if len(d) == 2 :
%o if d[0]*d[1] == i :
%o R.append(i)
%o return R
%o A006881_list(205) # _Peter Luschny_, Feb 07 2012
%o (Magma) [n: n in [1..210] | EulerPhi(n) + DivisorSigma(1,n) eq 2*(n+1)]; // _Vincenzo Librandi_, Sep 17 2015
%o (Python)
%o from sympy import factorint
%o def ok(n): f=factorint(n); return len(f) == 2 and sum(f[p] for p in f) == 2
%o print(list(filter(ok, range(1, 206)))) # _Michael S. Branicky_, Jun 10 2021
%o (Python)
%o from math import isqrt
%o from sympy import primepi, primerange
%o def A006881(n):
%o def f(x): return int(n+x+(t:=primepi(s:=isqrt(x)))+(t*(t-1)>>1)-sum(primepi(x//k) for k in primerange(1, s+1)))
%o m, k = n, f(n)
%o while m != k:
%o m, k = k, f(k)
%o return m # _Chai Wah Wu_, Aug 15 2024
%Y Products of exactly k distinct primes, for k = 1 to 6: A000040, A006881. A007304, A046386, A046387, A067885.
%Y Cf. A030229, A051709, A001221 (omega(n)), A001222 (bigomega(n)), A001358 (semiprimes), A005117 (squarefree), A007304 (squarefree 3-almost primes), A213952, A039833, A016105 (subsequences), A237114 (subsequence, n != 2).
%Y Subsequence of A007422.
%Y Cf. A259758 (subsequence), A036351, A363923.
%K nonn,easy,nice
%O 1,1
%A _N. J. A. Sloane_, _Robert Munafo_, _Simon Plouffe_
%E Name expanded (based on a comment of _Rick L. Shepherd_) by _Charles R Greathouse IV_, Sep 16 2015