[go: up one dir, main page]

login
A105700
a(n)=1 if n is a prime, 2 if n is a semiprime, otherwise 0.
13
0, 0, 1, 1, 2, 1, 2, 1, 0, 2, 2, 1, 0, 1, 2, 2, 0, 1, 0, 1, 0, 2, 2, 1, 0, 2, 2, 0, 0, 1, 0, 1, 0, 2, 2, 2, 0, 1, 2, 2, 0, 1, 0, 1, 0, 0, 2, 1, 0, 2, 0, 2, 0, 1, 0, 2, 0, 2, 2, 1, 0, 1, 2, 0, 0, 2, 0, 1, 0, 2, 0, 1, 0, 1, 2, 0, 0, 2, 0, 1, 0, 0, 2, 1, 0, 2, 2, 2, 0, 1, 0, 2, 0, 2, 2, 2, 0, 1, 0, 0, 0, 1, 0, 1, 0
OFFSET
0,5
FORMULA
If A001222(n) <= 2, a(n) = A001222(n), otherwise a(n) = 0. - Antti Karttunen, Jul 26 2017
EXAMPLE
a(4) = 1 because n=3 is a prime;
a(5) = 2 because n=4 is a semiprime;
a(9) = 0 because n=8 is not prime neither semiprime.
MATHEMATICA
psp[n_]:=Which[PrimeQ[n], 1, PrimeOmega[n]==2, 2, True, 0]; Join[{0}, Array[ psp, 110]] (* Harvey P. Dale, Sep 18 2011 *)
PROG
(Scheme) (define (A105700 n) (if (< (A001222 n) 3) (A001222 n) 0)) ;; Antti Karttunen, Jul 26 2017
CROSSREFS
Sequence in context: A118829 A118832 A122807 * A366077 A367169 A236831
KEYWORD
easy,nonn
AUTHOR
Giovanni Teofilatto, May 04 2005
STATUS
approved