login
If n is odd, then a(n) = 0; otherwise, a(n) = n.
9

%I #135 Jun 24 2022 17:20:08

%S 0,0,2,0,4,0,6,0,8,0,10,0,12,0,14,0,16,0,18,0,20,0,22,0,24,0,26,0,28,

%T 0,30,0,32,0,34,0,36,0,38,0,40,0,42,0,44,0,46,0,48,0,50,0,52,0,54,0,

%U 56,0,58,0,60,0,62,0,64,0,66,0,68,0,70,0,72,0,74

%N If n is odd, then a(n) = 0; otherwise, a(n) = n.

%C Normally the OEIS excludes sequences in which every other term is zero. But there are exceptions for especially important sequences like this one. - _N. J. A. Sloane_, Feb 27 2014

%C Essentially the factorial expansion of exp(-1): exp(-1) = Sum_{n>=1} a(n)/(n+1)!. - _Joerg Arndt_, Mar 13 2014

%C a(n) is the number of m < n for which a(m) has the same parity as n. For instance, a(4) = 4 because 4 has the same parity as a(0), a(1), a(2), and a(3). - _Alec Jones_, May 16 2016

%C This sequence is an example of a sequence that has no limit while the Cesàro means limit is infinite. See A354280 for further information. - _Bernard Schott_, May 22 2022

%D J. M. Arnaudiès, P. Delezoide et H. Fraysse, Exercices résolus d'Analyse du cours de mathématiques - 2, Dunod, Exercice 10, pp. 14-16.

%H Vincenzo Librandi, <a href="/A237420/b237420.txt">Table of n, a(n) for n = 0..1000</a> (corrected by Ray Chandler, Jan 19 2019).

%H ProofWiki, <a href="https://proofwiki.org/wiki/Cesàro_Mean">Cesàro mean</a>.

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Ernesto_Cesàro">Ernesto Cesàro</a>.

%H Wikipédia, <a href="https://fr.wikipedia.org/wiki/Lemme_de_Cesàro">Lemme de Cesàro </a> (in French).

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,2,0,-1).

%F O.g.f.: 2*x^2/(1-x^2)^2.

%F E.g.f.: x*sinh(x). - _Robert Israel_, Aug 27 2015

%F a(n) = 2*a(n-2) - a(n-4) for n>4.

%F a(n) = 2*A142150(n) = (1+(-1)^n)*n/2 = n*((n-1) mod 2).

%F a(n) = floor(n^(-1)^n) for n>1. - _Ilya Gutkovskiy_, Aug 27 2015

%F Sum_{i=1..n} a(i) = A110660(n). - _Bruno Berselli_, Feb 27 2014

%F a(n) = -1 + ceiling((n + 1)^(sin(Pi*n/2) + cos(Pi*n))). - _Lechoslaw Ratajczak_, Nov 06 2016

%p seq(op([0,2*i]),i=1..30); # _Robert Israel_, Aug 27 2015

%t Table[If[OddQ[n], 0, n], {n, 80}]

%t CoefficientList[Series[2 x /(1 - x^2)^2, {x, 0, 80}], x]

%t LinearRecurrence[{0, 2, 0, -1}, {0, 0, 2, 0}, 75] (* _Robert G. Wilson v_, Nov 11 2016 *)

%t Riffle[Range[0,80,2],0] (* _Harvey P. Dale_, Mar 16 2021 *)

%o (Magma) [IsOdd(n) select 0 else n: n in [1..80]];

%o (Magma) [(1+(-1)^n)*n/2: n in [1..80]];

%o (Magma) &cat [[n, 0]: n in [0..80 by 2]]; // _Bruno Berselli_, Nov 11 2016

%o (PARI) a(n)=if(n%2==0,n,0) \\ _Anders Hellström_, Aug 27 2015

%o (Python) def a(n): return 0 if n%2 else n # _Michael S. Branicky_, Jun 05 2022

%Y Cf. A005843, A110660, A142150, A193356, A354280.

%Y About the Cesàro mean theorem: A033999, A114112.

%K nonn,easy

%O 0,3

%A _Vincenzo Librandi_, Feb 24 2014

%E Edited by _Bruno Berselli_, Feb 27 2014