A101040 If n has one or two prime-factors then 1 else 0.
0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0
Offset: 1
Keywords
Links
Crossrefs
Characteristic function of A037143 (without its initial term 1).
Programs
-
Mathematica
a[n_] := If[n == 1, 0, Boole[PrimeOmega[n] <= 2]]; Array[a, 105] (* Jean-François Alcover, Dec 02 2021 *)
-
PARI
vector(105,k,bigomega(k)<=2&&k>1) \\ Hugo Pfoertner, Dec 02 2021
-
Scheme
(define (A101040 n) (if (= 1 n) 0 (A063524 (A032742 (A032742 n))))) ;; Antti Karttunen, Nov 23 2017
Comments