%I #80 Dec 21 2023 14:22:22
%S 0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,
%T 0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,
%U 0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0
%N Period 2: repeat [0, 2].
%C Euler number (or Euler characteristic) of (n+1)-sphere. - _Franz Vrabec_, Sep 07 2007
%C First differences of A109613. - _Reinhard Zumkeller_, Dec 05 2009
%C a(n) = Sum_{k=0..n-1} (-1)^k*N_k, for n >= 1, is Schläfli's generalization of Euler's formula for simply-connected n-dimensional polytopes. N_0 is the number of vertices, ..., N_{d-1} is the number of (d-1)-dimensional faces. See Coxeter's book for references, also for Poincaré's proof. - _Wolfdieter Lang_, Feb 09 2018
%D R. Carter, G. Segal, I. Macdonald, Lectures on Lie Groups and Lie Algebras, London Mathematical Society Student Texts 32, Cambridge University Press, 1995; see p. 68.
%D H. S. M. Coxeter, Regular Polytopes, third ed., Dover publications, New York, 1973, p. 165.
%H Muniru A Asiru, <a href="/A010673/b010673.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (0,1).
%F a(n) = 1 - (-1)^n.
%F a(n) = 2*(n mod 2). - _Paolo P. Lava_, Oct 20 2006
%F G.f.: -2*x / ((x-1)*(1+x)). - _R. J. Mathar_, Apr 06 2011
%F E.g.f.: (exp(2*x) - 1)/exp(x). - _Elmo R. Oliveira_, Dec 19 2023
%p seq(op([0,2]),n=0..80); # _Muniru A Asiru_, Oct 26 2018
%t PadRight[{},120,{0,2}] (* or *) LinearRecurrence[{0,1},{0,2},120] (* _Harvey P. Dale_, May 29 2016 *)
%o (Maxima) makelist(if evenp(n) then 0 else 2, n, 0, 30); /* _Martin Ettl_, Nov 11 2012 */
%o (Maxima) makelist(concat(0,", ",2), n, 0, 40); /* _Bruno Berselli_, Nov 13 2012 */
%o (PARI) a(n)=1-(-1)^n \\ _Charles R Greathouse IV_, Oct 07 2015
%o (GAP) Flat(List([0..80],n->[0,2])); # _Muniru A Asiru_, Oct 26 2018
%Y Cf. A109613.
%K nonn,easy
%O 0,2
%A _N. J. A. Sloane_