A037143 Numbers with at most 2 prime factors (counted with multiplicity).
1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 14, 15, 17, 19, 21, 22, 23, 25, 26, 29, 31, 33, 34, 35, 37, 38, 39, 41, 43, 46, 47, 49, 51, 53, 55, 57, 58, 59, 61, 62, 65, 67, 69, 71, 73, 74, 77, 79, 82, 83, 85, 86, 87, 89, 91, 93, 94, 95, 97, 101, 103, 106, 107, 109, 111, 113, 115, 118
Offset: 1
Keywords
Links
- Felix Fröhlich, Table of n, a(n) for n = 1..10000 (first 1000 terms from Reinhard Zumkeller)
- Andreas Weingartner, Uniform distribution of alpha*n modulo one for a family of integer sequences, arXiv:2303.16819 [math.NT], 2023.
Crossrefs
Programs
-
Haskell
a037143 n = a037143_list !! (n-1) a037143_list = 1 : merge a000040_list a001358_list where merge xs'@(x:xs) ys'@(y:ys) = if x < y then x : merge xs ys' else y : merge xs' ys -- Reinhard Zumkeller, Dec 18 2012
-
Maple
with(numtheory): A037143:=n->`if`(bigomega(n)<3,n,NULL): seq(A037143(n), n=1..200); # Wesley Ivan Hurt, May 03 2015
-
Mathematica
Select[Range[120], PrimeOmega[#] <= 2 &] (* Ivan Neretin, Aug 16 2015 *)
-
PARI
is(n)=bigomega(n)<3 \\ Charles R Greathouse IV, Apr 29 2015
-
Python
from math import isqrt from sympy import primepi, primerange def A037143(n): def f(x): return int(n-2+x-primepi(x)-sum(primepi(x//k)-a for a,k in enumerate(primerange(isqrt(x)+1)))) kmin, kmax = 1,2 while f(kmax) >= kmax: kmax <<= 1 while True: kmid = kmax+kmin>>1 if f(kmid) < kmid: kmax = kmid else: kmin = kmid if kmax-kmin <= 1: break return kmax # Chai Wah Wu, Aug 23 2024
Extensions
More terms from Henry Bottomley, Aug 15 2001
Comments