cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A014612 Numbers that are the product of exactly three (not necessarily distinct) primes.

This page as a plain text file.
%I A014612 #148 Feb 16 2025 08:32:33
%S A014612 8,12,18,20,27,28,30,42,44,45,50,52,63,66,68,70,75,76,78,92,98,99,102,
%T A014612 105,110,114,116,117,124,125,130,138,147,148,153,154,164,165,170,171,
%U A014612 172,174,175,182,186,188,190,195,207,212,222,230,231,236,238,242,244
%N A014612 Numbers that are the product of exactly three (not necessarily distinct) primes.
%C A014612 Sometimes called "triprimes" or "3-almost primes".
%C A014612 See also A001358 for product of two primes (sometimes called semiprimes).
%C A014612 If you graph a(n)/n for n up to 10000 (and probably quite a bit higher), it appears to be converging to something near 3.9. In fact the limit is infinite. - _Franklin T. Adams-Watters_, Sep 20 2006
%C A014612 Meng shows that for any sufficiently large odd integer n, the equation n = a + b + c has solutions where each of a, b, c is 3-almost prime. The number of such solutions is (log log n)^6/(16 (log n)^3)*n^2*s(n)*(1 + O(1/log log n)), where s(n) = Sum_{q >= 1} Sum_{a = 1..q, (a, q) = 1} exp(i*2*Pi*n*a/q)*mu(n)/phi(n)^3 > 1/2. - _Jonathan Vos Post_, Sep 16 2005, corrected & rewritten by _M. F. Hasler_, Apr 24 2019
%C A014612 Also, a(n) are the numbers such that exactly half of their divisors are composite. For the numbers in which exactly half of the divisors are prime, see A167171. - _Ivan Neretin_, Jan 12 2016
%D A014612 Edmund Landau, Handbuch der Lehre von der Verteilung der Primzahlen, Vol. 1, Teubner, Leipzig; third edition : Chelsea, New York (1974). See p. 211.
%H A014612 T. D. Noe, <a href="/A014612/b014612.txt">Table of n, a(n) for n = 1..10000</a>
%H A014612 Edmund Landau, Handbuch der Lehre von der Verteilung der Primzahlen, <a href="http://name.umdl.umich.edu/ABV2766.0001.001">vol. 1</a> and <a href="http://name.umdl.umich.edu/ABV2766.0002.001">vol. 2</a>, Leipzig, Berlin, B. G. Teubner, 1909. See Vol. 1, p. 211.
%H A014612 Xianmeng Meng, <a href="http://dx.doi.org/10.1016/j.jnt.2005.04.013">On sums of three integers with a fixed number of prime factors</a>, Journal of Number Theory, Vol. 114 (2005), pp. 37-65.
%H A014612 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/AlmostPrime.html">Almost Prime</a>
%F A014612 Product p_i^e_i with Sum e_i = 3.
%F A014612 a(n) ~ 2n log n / (log log n)^2 as n -> infinity [Landau, p. 211].
%F A014612 Tau(a(n)) = 2 * (omega(a(n)) + 1) = 2*A083399(a(n)), where tau = A000005 and omega = A001221. - _Wesley Ivan Hurt_, Jun 28 2013
%F A014612 a(n) = A078840(3,n). - _R. J. Mathar_, Jan 30 2019
%e A014612 From _Gus Wiseman_, Nov 04 2020: (Start)
%e A014612 Also Heinz numbers of integer partitions into three parts, counted by A001399(n-3) = A069905(n) with ordered version A000217, where the Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). The sequence of terms together with their prime indices begins:
%e A014612       8: {1,1,1}     70: {1,3,4}     130: {1,3,6}
%e A014612      12: {1,1,2}     75: {2,3,3}     138: {1,2,9}
%e A014612      18: {1,2,2}     76: {1,1,8}     147: {2,4,4}
%e A014612      20: {1,1,3}     78: {1,2,6}     148: {1,1,12}
%e A014612      27: {2,2,2}     92: {1,1,9}     153: {2,2,7}
%e A014612      28: {1,1,4}     98: {1,4,4}     154: {1,4,5}
%e A014612      30: {1,2,3}     99: {2,2,5}     164: {1,1,13}
%e A014612      42: {1,2,4}    102: {1,2,7}     165: {2,3,5}
%e A014612      44: {1,1,5}    105: {2,3,4}     170: {1,3,7}
%e A014612      45: {2,2,3}    110: {1,3,5}     171: {2,2,8}
%e A014612      50: {1,3,3}    114: {1,2,8}     172: {1,1,14}
%e A014612      52: {1,1,6}    116: {1,1,10}    174: {1,2,10}
%e A014612      63: {2,2,4}    117: {2,2,6}     175: {3,3,4}
%e A014612      66: {1,2,5}    124: {1,1,11}    182: {1,4,6}
%e A014612      68: {1,1,7}    125: {3,3,3}     186: {1,2,11}
%e A014612 (End)
%p A014612 with(numtheory); A014612:=n->`if`(bigomega(n)=3, n, NULL); seq(A014612(n), n=1..250) # _Wesley Ivan Hurt_, Feb 05 2014
%t A014612 threeAlmostPrimeQ[n_] := Plus @@ Last /@ FactorInteger@n == 3; Select[ Range@244, threeAlmostPrimeQ[ # ] &] (* _Robert G. Wilson v_, Jan 04 2006 *)
%t A014612 NextkAlmostPrime[n_, k_: 2, m_: 1] := Block[{c = 0, sgn = Sign[m]}, kap = n + sgn; While[c < Abs[m], While[ PrimeOmega[kap] != k, If[sgn < 0, kap--, kap++]]; If[ sgn < 0, kap--, kap++]; c++]; kap + If[sgn < 0, 1, -1]]; NestList[NextkAlmostPrime[#, 3] &, 2^3, 56] (* _Robert G. Wilson v_, Jan 27 2013 *)
%t A014612 Select[Range[244], PrimeOmega[#] == 3 &] (* _Jayanta Basu_, Jul 01 2013 *)
%o A014612 (PARI) isA014612(n)=bigomega(n)==3 \\ _Charles R Greathouse IV_, May 07 2011
%o A014612 (PARI) list(lim)=my(v=List(),t);forprime(p=2,lim\4, forprime(q=2,min(lim\(2*p),p), t=p*q; forprime(r=2,min(lim\t,q),listput(v,t*r)))); vecsort(Vec(v)) \\ _Charles R Greathouse IV_, Jan 04 2013
%o A014612 (Haskell) a014612 n = a014612_list !! (n-1)
%o A014612 a014612_list = filter ((== 3) . a001222) [1..] -- _Reinhard Zumkeller_, Apr 02 2012
%o A014612 (Scala) def primeFactors(number: Int, list: List[Int] = List())
%o A014612                                                       : List[Int] = {
%o A014612   for (n <- 2 to number if (number % n == 0)) {
%o A014612     return primeFactors(number / n, list :+ n)
%o A014612   }
%o A014612   list
%o A014612 }
%o A014612 (1 to 250).filter(primeFactors(_).size == 3) // _Alonso del Arte_, Nov 04 2020, based on algorithm by Victor Farcic (vfarcic)
%o A014612 (Python)
%o A014612 from sympy import factorint
%o A014612 def ok(n): f = factorint(n); return sum(f[p] for p in f) == 3
%o A014612 print(list(filter(ok, range(245)))) # _Michael S. Branicky_, Aug 12 2021
%o A014612 (Python)
%o A014612 from math import isqrt
%o A014612 from sympy import primepi, primerange, integer_nthroot
%o A014612 def A014612(n):
%o A014612     def f(x): return int(n+x-sum(primepi(x//(k*m))-b for a,k in enumerate(primerange(integer_nthroot(x,3)[0]+1)) for b,m in enumerate(primerange(k,isqrt(x//k)+1),a)))
%o A014612     m, k = n, f(n)
%o A014612     while m != k:
%o A014612         m, k = k, f(k)
%o A014612     return m # _Chai Wah Wu_, Aug 17 2024
%Y A014612 Cf. A000040, A001358 (biprimes), A014613 (quadruprimes), A033942, A086062, A098238, A123072, A123073, A101605 (characteristic function).
%Y A014612 Cf. A109251 (number of 3-almost primes <= 10^n).
%Y A014612 Subsequence of A145784. - _Reinhard Zumkeller_, Oct 19 2008
%Y A014612 Cf. A007304 is the squarefree case.
%Y A014612 Sequences listing r-almost primes, that is, the n such that A001222(n) = r: A000040 (r = 1), A001358 (r = 2), this sequence (r = 3), A014613 (r = 4), A014614 (r = 5), A046306 (r = 6), A046308 (r = 7), A046310 (r = 8), A046312 (r = 9), A046314 (r = 10), A069272 (r = 11), A069273 (r = 12), A069274 (r = 13), A069275 (r = 14), A069276 (r = 15), A069277 (r = 16), A069278 (r = 17), A069279 (r = 18), A069280 (r = 19), A069281 (r = 20). - _Jason Kimberley_, Oct 02 2011
%Y A014612 Cf. A253721 (final digits).
%Y A014612 A014311 is a different ranking of ordered triples, with strict case A337453.
%Y A014612 A046316 is the restriction to odds, with strict case A307534.
%Y A014612 A075818 is the restriction to evens, with strict case A075819.
%Y A014612 A285508 is the nonsquarefree case.
%Y A014612 A001399(n-3) = A069905(n) = A211540(n+2) counts 3-part partitions.
%Y A014612 Cf. A000212, A000217, A046389, A140106, A307719, A321773.
%K A014612 nonn
%O A014612 1,1
%A A014612 _Eric W. Weisstein_
%E A014612 More terms from _Patrick De Geest_, Jun 15 1998