login
Blocks of 4 numbers of the form 2k, 2k-1, 2k, 2k+1, k=1,2,3,4,...
7

%I #34 Feb 16 2025 08:33:10

%S 2,1,2,3,4,3,4,5,6,5,6,7,8,7,8,9,10,9,10,11,12,11,12,13,14,13,14,15,

%T 16,15,16,17,18,17,18,19,20,19,20,21,22,21,22,23,24,23,24,25,26,25,26,

%U 27,28,27,28,29,30,29,30,31,32,31,32,33,34,33,34,35,36,35,36,37,38,37

%N Blocks of 4 numbers of the form 2k, 2k-1, 2k, 2k+1, k=1,2,3,4,...

%C This illustrates the infinite product Pi/2 = Product_{k>=1} ((2*k)/(2k-1))*((2k)/(2k+1)): read the 4 terms of numerator and denominator of the factor in the product in that order shown.

%C Number of roots of the polynomial 1+x+x^2+...+x^(n+1) = (x^(n+2)-1)/(x-1) in the left half plane. - _Michel Lagneau_, Oct 30 2012

%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/WallisFormula.html">Wallis Formula</a>.

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

%F a(n) = a(n-1) + a(n-4) - a(n-5).

%F G.f.: x*(2-x+x^2+x^3-x^4)/((1+x)*(1+x^2)*(1-x)^2).

%F a(n) = n + 1 - 2*floor( (n+2)/4 ). - _M. F. Hasler_, Nov 01 2012

%F a(n) = (2*n + 3 - (-1)^n + 2*(-1)^((2*n - 1 + (-1)^n)/4))/4. - _Luce ETIENNE_, Mar 08 2016

%F Sum_{n>=1} (-1)^n/a(n) = 2*log(2) - 1. - _Amiram Eldar_, Sep 10 2023

%t Flatten[#+{0,-1,0,1}&/@Range[2,40,2]] (* _Harvey P. Dale_, Aug 12 2014 *)

%o (PARI) A162330(n)=n+1-(n+2)\4*2 \\ _M. F. Hasler_, Nov 01 2012

%Y Cf. A000796, A019669, A134967, A183041.

%K nonn,easy

%O 1,1

%A _Juri-Stepan Gerasimov_, Jul 01 2009

%E Edited by _R. J. Mathar_, Sep 16 2009