cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A107279 #15 Feb 12 2024 12:44:10
%S A107279 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 A107279 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 A107279 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 A107279 a(n) = 1 if n is an odd prime, a(n) = 2 if n is a nonzero even number, otherwise a(n) = 0.
%H A107279 Antti Karttunen, <a href="/A107279/b107279.txt">Table of n, a(n) for n = 0..5000</a>
%t A107279 Table[ If[n==0,0,If[EvenQ[n], 2,If[PrimeQ[n], 1, 0]]], {n, 0, 99}] (* _James C. McMahon_, Feb 10 2024 *)
%o A107279 (Scheme) (define (A107279 n) (cond ((<= n 1) 0) ((even? n) 2) (else (A010051 n)))) ;; _Antti Karttunen_, Sep 14 2017
%Y A107279 Cf. A010051, A105661.
%K A107279 easy,nonn
%O A107279 0,3
%A A107279 _Giovanni Teofilatto_, May 19 2005
%E A107279 Description corrected by _Antti Karttunen_, Sep 14 2017