A062157 a(n) = 0^n - (-1)^n.
0, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1
Offset: 0
Examples
G.f. = x - x^2 + x^3 - x^4 + x^5 - x^6 + x^7 - x^8 + x^9 - x^10 + ... - _Michael Somos_, Feb 20 2024
Links
- Antti Karttunen, Table of n, a(n) for n = 0..10000
- Wikipedia, Dirichlet eta function
- Index entries for linear recurrences with constant coefficients, signature (-1).
Programs
-
Magma
[0^n-(-1)^n: n in [0..100]]; // Vincenzo Librandi, Aug 15 2015
-
Magma
[0] cat &cat[ [1, -1]: n in [1..80] ]; // Vincenzo Librandi, Aug 15 2015
-
Mathematica
PadRight[{0},120,{-1,1}] (* Harvey P. Dale, Aug 20 2012 *) Join[{0},LinearRecurrence[{-1},{1},101]] (* Ray Chandler, Aug 12 2015 *) f[n_] := 0^n - (-1)^n; f[0] = 0; Array[f, 105, 0] (* or *) CoefficientList[ Series[ x/(1 + x), {x, 0, 80}], x] (* or *) Numerator@ CoefficientList[ Series[ Log[1 + x], {x, 0, 80}], x] (* Robert G. Wilson v, Aug 14 2015 *)
-
PARI
{a(n) = if( n<1, 0, -(-1)^n )}; /* Michael Somos, Jul 05 2009 */
Formula
G.f.: x/(1+x).
Euler transform of length 2 sequence [-1, 1]. - Michael Somos, Jul 05 2009
Moebius transform is length 2 sequence [1, -2]. - Michael Somos, Jul 05 2009
a(n) is multiplicative with a(2^e) = -1 if e > 0, a(p^e) = 1 if p > 2. - Michael Somos, Jul 05 2009
Dirichlet g.f.: zeta(s) * (1 - 2^(1-s)). - Michael Somos, Jul 05 2009
Also, Dirichlet g.f.: eta(s). - Ralf Stephan, Mar 25 2015
E.g.f.: 1 - exp(-x). - Alejandro J. Becerra Jr., Feb 16 2021
Comments