This site is supported by donations to The OEIS Foundation.

 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

%I

%S 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,

%T 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,

%U 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

%N a(n)=1 if n is a prime, 2 if n is a semiprime, otherwise 0.

%H Antti Karttunen, <a href="/A105700/b105700.txt">Table of n, a(n) for n = 0..10000</a>

%H <a href="/index/Eu#epf">Index entries for sequences computed from exponents in factorization of n</a>

%F If A001222(n) <= 2, a(n) = A001222(n), otherwise a(n) = 0. - _Antti Karttunen_, Jul 26 2017

%e a(4) = 1 because n=3 is a prime;

%e a(5) = 2 because n=4 is a semiprime;

%e a(9) = 0 because n=8 is not prime neither semiprime.

%t psp[n_]:=Which[PrimeQ[n],1,PrimeOmega[n]==2,2,True,0]; Join[{0}, Array[ psp,110]] (* _Harvey P. Dale_, Sep 18 2011 *)

%o (Scheme) (define (A105700 n) (if (< (A001222 n) 3) (A001222 n) 0)) ;; _Antti Karttunen_, Jul 26 2017

%Y Cf. A001222, A105661.

%K easy,nonn

%O 0,5

%A _Giovanni Teofilatto_, May 04 2005

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.

Last modified July 17 21:31 EDT 2019. Contains 325109 sequences. (Running on oeis4.)