login
First differences of A186421.
8

%I #24 Sep 08 2022 08:45:55

%S 1,1,-1,3,-1,3,-3,5,-3,5,-5,7,-5,7,-7,9,-7,9,-9,11,-9,11,-11,13,-11,

%T 13,-13,15,-13,15,-15,17,-15,17,-17,19,-17,19,-19,21,-19,21,-21,23,

%U -21,23,-23,25,-23,25,-25,27,-25,27,-27,29,-27,29,-29,31,-29,31,-31,33,-31,33,-33,35,-33,35,-35,37,-35,37,-37,39,-37,39,-39,41,-39,41,-41,43

%N First differences of A186421.

%C a(n) = A186421(n+1) - A186421(n);

%C a(2*n) = - A109613(n-1) for n>0; a(2*n+1) = A109613(n);

%C a(3*k) = A047270(floor((k+1)/2)) * (-1)^(k+1);

%C a(3*k+1) = A007310(floor((k+2)/2)) * (-1)^k;

%C a(3*k+2) = A047241(floor((k+3)/2)) * (-1)^(k+1).

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

%F G.f.: -(x^4+2*x^3+2*x+1) / ((x-1)*(x+1)^2*(x^2+1)). - _Colin Barker_, Mar 04 2013

%F a(n) = -((2*n+1)*(-1)^n-2*i^(n*(n+1))-3)/4, where i=sqrt(-1). [_Bruno Berselli_, Mar 04 2013]

%F a(n) = cos((n-1)*Pi)*(2*n+1-2*cos(n*Pi/2)-3*cos(n*Pi)-2*sin(n*Pi/2))/4. - _Wesley Ivan Hurt_, Oct 02 2017

%F E.g.f.: (cos(x) + (1 + x)*cosh(x) - sin(x) - (x - 2)*sinh(x))/2. - _Stefano Spezia_, May 09 2021

%t Differences@ CoefficientList[Series[x (1 + 2 x + 2 x^3 + x^4)/((1 + x^2) (x - 1)^2 (1 + x)^2), {x, 0, 84}], x] (* _Michael De Vlieger_, Oct 02 2017 *)

%o (Haskell)

%o a186422 n = a186422_list !! n

%o a186422_list = zipWith (-) (tail a186421_list) a186421_list

%o (Maxima) makelist(-((2*n+1)*(-1)^n-2*%i^(n*(n+1))-3)/4,n,0,83); /* _Bruno Berselli_, Mar 04 2013 */

%o (Magma) /* By definition: */

%o A186421:=func<m | Floor(m-(1-(-1)^m)*(m+(-1)^(m*(m+1)/2))/4)>;

%o [A186421(n+1)-A186421(n): n in [0..90]]; // _Bruno Berselli_, Mar 04 2013

%Y Cf. A007310, A047241, A047270, A109613, A186421.

%K sign,easy

%O 0,4

%A _Reinhard Zumkeller_, Feb 21 2011