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!)
A105661 a(n)=1 if n is a prime, 2 if n is an even semiprime, otherwise 0. 3

%I #11 Jul 05 2021 16:30:19

%S 0,1,1,2,1,2,1,0,0,2,1,0,1,2,0,0,1,0,1,0,0,2,1,0,0,2,0,0,1,0,1,0,0,2,

%T 0,0,1,2,0,0,1,0,1,0,0,2,1,0,0,0,0,0,1,0,0,0,0,2,1,0,1,2,0,0,0,0,1,0,

%U 0,0,1,0,1,2,0,0,0,0,1,0,0,2,1,0,0,2,0,0,1,0,0,0,0,2,0,0,1,0,0,0,1,0,1,0,0

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

%H Antti Karttunen, <a href="/A105661/b105661.txt">Table of n, a(n) for n = 1..10000</a>

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

%e a(4) = 2 because n = 4 = 2*2 is an even semiprime;

%e a(8) = 0 because n = 8 is neither prime nor an even semiprime.

%e a(15) = 0 because n = 15 = 3*5 is an odd semiprime.

%t Table[Which[PrimeQ[n],1,EvenQ[n]&&PrimeOmega[n]==2,2,True,0],{n,120}] (* _Harvey P. Dale_, Jul 05 2021 *)

%o (PARI) for(n=1,105,if((n%2==0)&&(bigomega(n)==2),r=2,r=isprime(n));print1(r,","))

%o (Scheme) (define (A105661 n) (cond ((= 1 (A001222 n)) 1) ((and (even? n) (= 2 (A001222 n))) 2) (else 0))) ;; _Antti Karttunen_, Jul 26 2017

%Y Cf. A001222, A001751, A105700.

%K easy,nonn

%O 1,4

%A _Giovanni Teofilatto_, May 04 2005

%E Corrected and extended by _Rick L. Shepherd_, May 17 2005

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 23 06:45 EDT 2024. Contains 371906 sequences. (Running on oeis4.)