login
This site is supported by donations 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

Antti Karttunen, Table of n, a(n) for n = 0..10000

Index entries for sequences computed from exponents in factorization of n

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

Cf. A001222, A105661.

Sequence in context: A118829 A118832 A122807 * A236831 A030205 A159817

Adjacent sequences:  A105697 A105698 A105699 * A105701 A105702 A105703

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 15 20:50 EDT 2019. Contains 324145 sequences. (Running on oeis4.)