login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
LINKS
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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 06:49 EDT 2024. Contains 371964 sequences. (Running on oeis4.)