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!)
A107279 a(n) = 1 if n is an odd prime, a(n) = 2 if n is a nonzero even number, otherwise a(n) = 0. 1

%I #15 Feb 12 2024 12:44:10

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

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

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

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

%H Antti Karttunen, <a href="/A107279/b107279.txt">Table of n, a(n) for n = 0..5000</a>

%t Table[ If[n==0,0,If[EvenQ[n], 2,If[PrimeQ[n], 1, 0]]], {n, 0, 99}] (* _James C. McMahon_, Feb 10 2024 *)

%o (Scheme) (define (A107279 n) (cond ((<= n 1) 0) ((even? n) 2) (else (A010051 n)))) ;; _Antti Karttunen_, Sep 14 2017

%Y Cf. A010051, A105661.

%K easy,nonn

%O 0,3

%A _Giovanni Teofilatto_, May 19 2005

%E Description corrected by _Antti Karttunen_, Sep 14 2017

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 19 02:10 EDT 2024. Contains 371782 sequences. (Running on oeis4.)