A014612
Numbers that are the product of exactly three (not necessarily distinct) primes.
Original entry on oeis.org
8, 12, 18, 20, 27, 28, 30, 42, 44, 45, 50, 52, 63, 66, 68, 70, 75, 76, 78, 92, 98, 99, 102, 105, 110, 114, 116, 117, 124, 125, 130, 138, 147, 148, 153, 154, 164, 165, 170, 171, 172, 174, 175, 182, 186, 188, 190, 195, 207, 212, 222, 230, 231, 236, 238, 242, 244
Offset: 1
From _Gus Wiseman_, Nov 04 2020: (Start)
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:
8: {1,1,1} 70: {1,3,4} 130: {1,3,6}
12: {1,1,2} 75: {2,3,3} 138: {1,2,9}
18: {1,2,2} 76: {1,1,8} 147: {2,4,4}
20: {1,1,3} 78: {1,2,6} 148: {1,1,12}
27: {2,2,2} 92: {1,1,9} 153: {2,2,7}
28: {1,1,4} 98: {1,4,4} 154: {1,4,5}
30: {1,2,3} 99: {2,2,5} 164: {1,1,13}
42: {1,2,4} 102: {1,2,7} 165: {2,3,5}
44: {1,1,5} 105: {2,3,4} 170: {1,3,7}
45: {2,2,3} 110: {1,3,5} 171: {2,2,8}
50: {1,3,3} 114: {1,2,8} 172: {1,1,14}
52: {1,1,6} 116: {1,1,10} 174: {1,2,10}
63: {2,2,4} 117: {2,2,6} 175: {3,3,4}
66: {1,2,5} 124: {1,1,11} 182: {1,4,6}
68: {1,1,7} 125: {3,3,3} 186: {1,2,11}
(End)
- Edmund Landau, Handbuch der Lehre von der Verteilung der Primzahlen, Vol. 1, Teubner, Leipzig; third edition : Chelsea, New York (1974). See p. 211.
- T. D. Noe, Table of n, a(n) for n = 1..10000
- Edmund Landau, Handbuch der Lehre von der Verteilung der Primzahlen, vol. 1 and vol. 2, Leipzig, Berlin, B. G. Teubner, 1909. See Vol. 1, p. 211.
- Xianmeng Meng, On sums of three integers with a fixed number of prime factors, Journal of Number Theory, Vol. 114 (2005), pp. 37-65.
- Eric Weisstein's World of Mathematics, Almost Prime
Cf.
A109251 (number of 3-almost primes <= 10^n).
Cf.
A007304 is the squarefree case.
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
A014311 is a different ranking of ordered triples, with strict case
A337453.
-
a014612 n = a014612_list !! (n-1)
a014612_list = filter ((== 3) . a001222) [1..] -- Reinhard Zumkeller, Apr 02 2012
-
with(numtheory); A014612:=n->`if`(bigomega(n)=3, n, NULL); seq(A014612(n), n=1..250) # Wesley Ivan Hurt, Feb 05 2014
-
threeAlmostPrimeQ[n_] := Plus @@ Last /@ FactorInteger@n == 3; Select[ Range@244, threeAlmostPrimeQ[ # ] &] (* Robert G. Wilson v, Jan 04 2006 *)
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 *)
Select[Range[244], PrimeOmega[#] == 3 &] (* Jayanta Basu, Jul 01 2013 *)
-
isA014612(n)=bigomega(n)==3 \\ Charles R Greathouse IV, May 07 2011
-
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
-
from sympy import factorint
def ok(n): f = factorint(n); return sum(f[p] for p in f) == 3
print(list(filter(ok, range(245)))) # Michael S. Branicky, Aug 12 2021
-
from math import isqrt
from sympy import primepi, primerange, integer_nthroot
def A014612(n):
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)))
m, k = n, f(n)
while m != k:
m, k = k, f(k)
return m # Chai Wah Wu, Aug 17 2024
-
def primeFactors(number: Int, list: List[Int] = List())
: List[Int] = {
for (n <- 2 to number if (number % n == 0)) {
return primeFactors(number / n, list :+ n)
}
list
}
(1 to 250).filter(primeFactors().size == 3) // _Alonso del Arte, Nov 04 2020, based on algorithm by Victor Farcic (vfarcic)
A007304
Sphenic numbers: products of 3 distinct primes.
Original entry on oeis.org
30, 42, 66, 70, 78, 102, 105, 110, 114, 130, 138, 154, 165, 170, 174, 182, 186, 190, 195, 222, 230, 231, 238, 246, 255, 258, 266, 273, 282, 285, 286, 290, 310, 318, 322, 345, 354, 357, 366, 370, 374, 385, 399, 402, 406, 410, 418, 426, 429, 430, 434, 435, 438
Offset: 1
From _Gus Wiseman_, Nov 05 2020: (Start)
Also Heinz numbers of strict integer partitions into three parts, where the Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). These partitions are counted by A001399(n-6) = A069905(n-3), with ordered version A001399(n-6)*6. The sequence of terms together with their prime indices begins:
30: {1,2,3} 182: {1,4,6} 286: {1,5,6}
42: {1,2,4} 186: {1,2,11} 290: {1,3,10}
66: {1,2,5} 190: {1,3,8} 310: {1,3,11}
70: {1,3,4} 195: {2,3,6} 318: {1,2,16}
78: {1,2,6} 222: {1,2,12} 322: {1,4,9}
102: {1,2,7} 230: {1,3,9} 345: {2,3,9}
105: {2,3,4} 231: {2,4,5} 354: {1,2,17}
110: {1,3,5} 238: {1,4,7} 357: {2,4,7}
114: {1,2,8} 246: {1,2,13} 366: {1,2,18}
130: {1,3,6} 255: {2,3,7} 370: {1,3,12}
138: {1,2,9} 258: {1,2,14} 374: {1,5,7}
154: {1,4,5} 266: {1,4,8} 385: {3,4,5}
165: {2,3,5} 273: {2,4,6} 399: {2,4,8}
170: {1,3,7} 282: {1,2,15} 402: {1,2,19}
174: {1,2,10} 285: {2,3,8} 406: {1,4,10}
(End)
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- "Sphenic", The American Heritage Dictionary of the English Language, Fourth Edition, Houghton Mifflin Company, 2000.
Cf.
A002033,
A010051,
A020639,
A037074,
A046393,
A061299,
A067467,
A071140,
A096917,
A096918,
A096919,
A100765,
A103653,
A107464,
A107768,
A179643,
A179695.
For the following, NNS means "not necessarily strict".
A008289 counts strict partitions by sum and length.
A220377 counts 3-part pairwise coprime strict partitions (NNS:
A307719).
-
a007304 n = a007304_list !! (n-1)
a007304_list = filter f [1..] where
f u = p < q && q < w && a010051 w == 1 where
p = a020639 u; v = div u p; q = a020639 v; w = div v q
-- Reinhard Zumkeller, Mar 23 2014
-
with(numtheory): a:=proc(n) if bigomega(n)=3 and nops(factorset(n))=3 then n else fi end: seq(a(n),n=1..450); # Emeric Deutsch
A007304 := proc(n)
option remember;
local a;
if n =1 then
30;
else
for a from procname(n-1)+1 do
if bigomega(a)=3 and nops(factorset(a))=3 then
return a;
end if;
end do:
end if;
end proc: # R. J. Mathar, Dec 06 2016
is_a := proc(n) local P; P := NumberTheory:-PrimeFactors(n); nops(P) = 3 and n = mul(P) end:
A007304List := upto -> select(is_a, [seq(1..upto)]): # Peter Luschny, Apr 14 2025
-
Union[Flatten[Table[Prime[n]*Prime[m]*Prime[k], {k, 20}, {n, k+1, 20}, {m, n+1, 20}]]]
Take[ Sort@ Flatten@ Table[ Prime@i Prime@j Prime@k, {i, 3, 21}, {j, 2, i - 1}, {k, j - 1}], 53] (* Robert G. Wilson v *)
With[{upto=500},Sort[Select[Times@@@Subsets[Prime[Range[Ceiling[upto/6]]],{3}],#<=upto&]]] (* Harvey P. Dale, Jan 08 2015 *)
Select[Range[100],SquareFreeQ[#]&&PrimeOmega[#]==3&] (* Gus Wiseman, Nov 05 2020 *)
-
for(n=1,1e4,if(bigomega(n)==3 && omega(n)==3,print1(n", "))) \\ Charles R Greathouse IV, Jun 10 2011
-
list(lim)=my(v=List(),t);forprime(p=2,(lim)^(1/3),forprime(q=p+1,sqrt(lim\p),t=p*q;forprime(r=q+1,lim\t,listput(v,t*r))));vecsort(Vec(v)) \\ Charles R Greathouse IV, Jul 20 2011
-
list(lim)=my(v=List(), t); forprime(p=2, sqrtnint(lim\=1,3), forprime(q=p+1, sqrtint(lim\p), t=p*q; forprime(r=q+1, lim\t, listput(v, t*r)))); Set(v) \\ Charles R Greathouse IV, Jan 21 2025
-
from math import isqrt
from sympy import primepi, primerange, integer_nthroot
def A007304(n):
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),1) for b,m in enumerate(primerange(k+1,isqrt(x//k)+1),a+1)))
kmin, kmax = 0,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 # Chai Wah Wu, Aug 29 2024
-
def is_a(n):
P = prime_divisors(n)
return len(P) == 3 and prod(P) == n
print([n for n in range(1, 439) if is_a(n)]) # Peter Luschny, Apr 14 2025
Comment concerning number of divisors corrected by
R. J. Mathar, Aug 14 2009
A140106
Number of noncongruent diagonals in a regular n-gon.
Original entry on oeis.org
0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37
Offset: 1
The square (n=4) has two congruent diagonals; so a(4)=1. The regular pentagon also has congruent diagonals; so a(5)=1. Among all the diagonals in a regular hexagon, there are two noncongruent ones; hence a(6)=2, etc.
-
A140106:= func< n | n eq 1 select 0 else Floor((n-2)/2) >;
[A140106(n): n in [1..80]]; // G. C. Greubel, Feb 10 2023
-
with(numtheory): for n from 1 to 80 do:it:=0:
y:=[fsolve(bernoulli(n,x) , x, complex)] : for m from 1 to nops(y) do : if Re(y[m])<0 then it:=it+1:else fi:od: printf(`%d, `,it):od:
-
a[1]=0; a[n_?OddQ] := (n-3)/2; a[n_] := n/2-1; Array[a, 100] (* Jean-François Alcover, Nov 17 2015 *)
-
a(n)=if(n>1,n\2-1,0) \\ Charles R Greathouse IV, Oct 16 2015
-
def A140106(n): return n-2>>1 if n>1 else 0 # Chai Wah Wu, Sep 18 2023
-
def A140106(n): return 0 if (n==1) else (n-2)//2
[A140106(n) for n in range(1,81)] # G. C. Greubel, Feb 10 2023
A242887
Number T(n,k) of compositions of n into parts with distinct multiplicities and with exactly k parts; triangle T(n,k), n>=0, 0<=k<=n, read by rows.
Original entry on oeis.org
1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 3, 1, 0, 1, 0, 6, 4, 1, 0, 1, 1, 4, 4, 5, 1, 0, 1, 0, 9, 8, 15, 6, 1, 0, 1, 1, 9, 5, 15, 21, 7, 1, 0, 1, 0, 10, 8, 20, 6, 28, 8, 1, 0, 1, 1, 12, 12, 6, 96, 42, 36, 9, 1, 0, 1, 0, 15, 12, 30, 192, 168, 64, 45, 10, 1, 0, 1, 1, 13, 9, 20, 142, 238, 204, 93, 55, 11, 1
Offset: 0
T(5,1) = 1: [5].
T(5,3) = 6: [1,2,2], [2,1,2], [2,2,1], [1,1,3], [1,3,1], [3,1,1].
T(5,4) = 4: [1,1,1,2], [1,1,2,1], [1,2,1,1], [2,1,1,1].
T(5,5) = 1: [1,1,1,1,1].
Triangle T(n,k) begins:
1;
0, 1;
0, 1, 1;
0, 1, 0, 1;
0, 1, 1, 3, 1;
0, 1, 0, 6, 4, 1;
0, 1, 1, 4, 4, 5, 1;
0, 1, 0, 9, 8, 15, 6, 1;
0, 1, 1, 9, 5, 15, 21, 7, 1;
0, 1, 0, 10, 8, 20, 6, 28, 8, 1;
0, 1, 1, 12, 12, 6, 96, 42, 36, 9, 1;
Columns k=0-10 give:
A000007,
A057427,
A059841 (for n>1),
A321773,
A321774,
A321775,
A321776,
A321777,
A321778,
A321779,
A321780.
-
b:= proc(n, i, s) option remember; `if`(n=0, add(j, j=s)!,
`if`(i<1, 0, expand(add(`if`(j>0 and j in s, 0, x^j*
b(n-i*j, i-1,`if`(j=0, s, s union {j}))/j!), j=0..n/i))))
end:
T:= n-> (p-> seq(coeff(p,x,i), i=0..degree(p)))(b(n$2, {})):
seq(T(n), n=0..16);
-
b[n_, i_, s_] := b[n, i, s] = If[n==0, Total[s]!, If[i<1, 0, Expand[Sum[ If[j>0 && MemberQ[s, j], 0, x^j*b[n-i*j, i-1, If[j==0, s, s ~Union~ {j}] ]/j!], {j, 0, n/i}]]]]; T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, n, {}]]; Table[T[n], {n, 0, 16}] // Flatten (* Jean-François Alcover, Feb 08 2017, translated from Maple *)
-
T(n)={Vecrev(((r,k,b,w)->if(!k||!r, if(r,0,w!*x^w), sum(m=0, r\k, if(!m || !bittest(b,m), self()(r-k*m, k-1, bitor(b,1<Andrew Howroyd, Aug 31 2019
Showing 1-4 of 4 results.
Comments