A006881 Squarefree semiprimes: Numbers that are the product of two distinct primes.
6, 10, 14, 15, 21, 22, 26, 33, 34, 35, 38, 39, 46, 51, 55, 57, 58, 62, 65, 69, 74, 77, 82, 85, 86, 87, 91, 93, 94, 95, 106, 111, 115, 118, 119, 122, 123, 129, 133, 134, 141, 142, 143, 145, 146, 155, 158, 159, 161, 166, 177, 178, 183, 185, 187, 194, 201, 202, 203, 205
Offset: 1
References
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- Zervos, Marie: Sur une classe de nombres composés. Actes du Congrès interbalkanique de mathématiciens 267-268 (1935)
Links
- T. D. Noe, Table of n, a(n) for n = 1..10000
- D. A. Goldston, S. W. Graham, J. Pimtz and Y. Yildirim, "Small Gaps Between Primes or Almost Primes", arXiv:math/0506067 [math.NT], March 2005.
- G. T. Leavens and M. Vermeulen, 3x+1 search programs, Computers and Mathematics with Applications, 24 (1992), 79-99. (Annotated scanned copy)
- R. J. Mathar, Series of reciprocal powers of k-almost primes arXiv:0803.0900, table 6 k=2 shows sum 1/a(n)^s.
- Eric Weisstein's World of Mathematics, Semiprime
- Index to sequences related to prime signature
Crossrefs
Products of exactly k distinct primes, for k = 1 to 6: A000040, A006881. A007304, A046386, A046387, A067885.
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).
Subsequence of A007422.
Programs
-
Haskell
a006881 n = a006881_list !! (n-1) a006881_list = filter chi [1..] where chi n = p /= q && a010051 q == 1 where p = a020639 n q = n `div` p -- Reinhard Zumkeller, Aug 07 2011
-
Magma
[n: n in [1..210] | EulerPhi(n) + DivisorSigma(1,n) eq 2*(n+1)]; // Vincenzo Librandi, Sep 17 2015
-
Maple
N:= 1001: # to get all terms < N Primes:= select(isprime, [2,seq(2*k+1,k=1..floor(N/2))]): {seq(seq(p*q,q=Primes[1..ListTools:-BinaryPlace(Primes,N/p)]),p=Primes)} minus {seq(p^2,p=Primes)}; # Robert Israel, Jul 23 2014 # Alternative, using A001221: isA006881 := proc(n) if numtheory[bigomega](n) =2 and A001221(n) = 2 then true ; else false ; end if; end proc: 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; end proc: # R. J. Mathar, May 02 2010 # Alternative: with(NumberTheory): isA006881 := n -> is(NumberOfPrimeFactors(n, 'distinct') = 2 and NumberOfPrimeFactors(n) = 2): select(isA006881, [seq(1..205)]); # Peter Luschny, Jul 12 2023
-
Mathematica
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 *) sqFrSemiPrimeQ[n_] := Last@# & /@ FactorInteger@ n == {1, 1}; Select[Range[210], sqFrSemiPrimeQ] (* Robert G. Wilson v, Feb 07 2012 *) With[{upto=250},Select[Sort[Times@@@Subsets[Prime[Range[upto/2]],{2}]],#<=upto&]] (* Harvey P. Dale, Apr 30 2018 *)
-
PARI
for(n=1,214,if(bigomega(n)==2&&omega(n)==2,print1(n,",")))
-
PARI
for(n=1,214,if(bigomega(n)==2&&issquarefree(n),print1(n,",")))
-
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
-
Python
from sympy import factorint def ok(n): f=factorint(n); return len(f) == 2 and sum(f[p] for p in f) == 2 print(list(filter(ok, range(1, 206)))) # Michael S. Branicky, Jun 10 2021
-
Python
from math import isqrt from sympy import primepi, primerange def A006881(n): 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))) m, k = n, f(n) while m != k: m, k = k, f(k) return m # Chai Wah Wu, Aug 15 2024
-
Sage
def A006881_list(n) : R = [] for i in (6..n) : d = prime_divisors(i) if len(d) == 2 : if d[0]*d[1] == i : R.append(i) return R A006881_list(205) # Peter Luschny, Feb 07 2012
Formula
A056595(a(n)) = 3. - Reinhard Zumkeller, Aug 15 2011
A211110(a(n)) = 3. - Reinhard Zumkeller, Apr 02 2012
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
A050326(a(n)) = 2. - Reinhard Zumkeller, May 03 2013
sopf(a(n)) = a(n) - phi(a(n)) + 1 = sigma(a(n)) - a(n) - 1. - Wesley Ivan Hurt, May 18 2013
d(a(n)) = 4. Omega(a(n)) = 2. omega(a(n)) = 2. mu(a(n)) = 1. - Wesley Ivan Hurt, Jun 28 2013
a(n) ~ n log n/log log n. - Charles R Greathouse IV, Aug 22 2013
A089233(a(n)) = 1. - Reinhard Zumkeller, Sep 04 2013
From Peter Luschny, Jul 12 2023: (Start)
For k > 1: k is a term <=> A363923(k) = k. (End)
a(n) ~ n log n/log log n. - Charles R Greathouse IV, Jan 13 2025
Extensions
Name expanded (based on a comment of Rick L. Shepherd) by Charles R Greathouse IV, Sep 16 2015
Comments