login
a(2n) = -n, a(2n+1) = 2n+1.
2

%I #49 Sep 21 2023 01:45:40

%S 0,1,-1,3,-2,5,-3,7,-4,9,-5,11,-6,13,-7,15,-8,17,-9,19,-10,21,-11,23,

%T -12,25,-13,27,-14,29,-15,31,-16,33,-17,35,-18,37,-19,39,-20,41,-21,

%U 43,-22,45,-23,47,-24,49,-25,51,-26,53,-27,55,-28,57,-29,59,-30,61,-31,63,-32,65,-33,67,-34,69,-35

%N a(2n) = -n, a(2n+1) = 2n+1.

%C There is more complicated way of defining the sequence: consider the sequence of modified Bernoulli numbers EVB(n) = A176327(n)/A176289(n) and its inverse binomial transform IEVB(n) = A176328(n)/A176591(n). Then a(n) is the numerator of the difference EVB(n)-IEVB(n). The denominator of the difference is 1 if n=0, else A040001(n-1).

%C A particularity of EVB(n) is: its (forward) binomial transform is 1, 1, 7/6, 3/2, 59/30,.. = (-1)^n*IEVB(n).

%C Note that A026741 is related to the Rydberg-Ritz spectrum of the hydrogen atom.

%H R. J. Mathar, <a href="/A176447/b176447.txt">Table of n, a(n) for n = 0..1000</a>

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

%F From _R. J. Mathar_, Dec 01 2010: (Start)

%F a(n) = (-1)^n*A026741(n) = n*(1-3*(-1)^n)/4.

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

%F a(n) = +2*a(n-2) -a(n-4). (End)

%F a(n) = -a(-n) for all n in Z. - _Michael Somos_, Jun 11 2013

%F From _Michael Somos_, Aug 30 2014: (Start)

%F Euler transform of length 6 sequence [ -1, 3, 1, 0, 0, -1].

%F 0 = - 1 - a(n) - a(n+1) + a(n+2) + a(n+3) for all n in Z.

%F 0 = 1 + a(n)*(-2 -a(n) + a(n+2)) - 2*a(n+1) - a(n+2) for all n in Z. (End)

%F From _Michael Somos_, May 04 2015: (Start)

%F a(n) is multiplicative with a(2^e) = -(2^(e-1)) if e>0, a(p^e) = p^e otherwise.

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

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

%F From _Amiram Eldar_, Sep 21 2023: (Start)

%F Dirichlet g.f.: zeta(s-1) * (1 - 3/2^s).

%F Sum_{k=0..n} a(k) = A008795(n-1), for n > 0.

%F Sum_{k=0..n} a(k) ~ n^2/8. (End)

%e G.f. = x - x^2 + 3*x^3 - 2*x^4 + 5*x^5 - 3*x^6 + 7*x^7 - 4*x^8 + 9*x^9 - 5*x^10 + ...

%t a[n_?EvenQ]:=-(n/2); a[n_?OddQ]:=n; Table[a[n], {n, 100}] (* _Alonso del Arte_, Dec 01 2010 *)

%t a[ n_] := n / If[ Mod[ n, 2] == 1, 1, -2]; (* _Michael Somos_, Jun 11 2013 *)

%t CoefficientList[Series[x (1 - x + x^2)/((x - 1)^2*(1 + x)^2), {x, 0, 70}], x] (* _Michael De Vlieger_, Dec 10 2016 *)

%t LinearRecurrence[{0,2,0,-1},{0,1,-1,3},80] (* _Harvey P. Dale_, Nov 01 2017 *)

%o (Magma) [n*(1-3*(-1)^n)/4: n in [0..60]]; // _Vincenzo Librandi_, Aug 04 2011

%o (PARI) {a(n) = n / if( n%2, 1, -2)}; /* _Michael Somos_, Jun 11 2013 */

%Y Cf. A008795, A026741, A040001, A176289, A176327, A176328, A176591.

%K sign,easy,mult

%O 0,4

%A _Paul Curtz_, Apr 18 2010