A099837 Expansion of (1 - x^2) / (1 + x + x^2) in powers of x.
1, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1
Offset: 0
Examples
G.f. = 1 - x - x^2 + 2*x^3 - x^4 - x^5 + 2*x^6 - x^7 - x^8 + 2*x^9 - x^10 + ...
Links
- Michael Somos, Rational Function Multiplicative Coefficients
- Index entries for linear recurrences with constant coefficients, signature (-1,-1).
Programs
-
Maple
A099837 := proc(n) option remember; if n <=2 then op(n+1,[1,-1,-1]) ; else -procname(n-1)-procname(n-2) ; end if; end proc: seq(A099837(n),n=0..80) ; # R. J. Mathar, Apr 26 2022
-
Mathematica
a[0] = 1; a[n_] := Mod[n+2, 3] - Mod[n, 3]; A099837 = Table[a[n], {n, 0, 71}](* Jean-François Alcover, Feb 15 2012, after Michael Somos *) LinearRecurrence[{-1, -1}, {1, -1, -1}, 50] (* G. C. Greubel, Aug 08 2017 *)
-
Maxima
A099837(n) := block( if n = 0 then 1 else [2,-1,-1][1+mod(n,3)] )$ /* R. J. Mathar, Mar 19 2012 */
-
PARI
{a(n) = [2, -1, -1][n%3 + 1] - (n == 0)}; /* Michael Somos, Jan 19 2012 */
-
PARI
Vec((1-x^2)/(1+x+x^2) + O(x^20)) \\ Felix Fröhlich, Aug 08 2017
Formula
G.f.: (1-x^2)/(1+x+x^2).
Euler transform of length 3 sequence [-1, -1, 1]. - Michael Somos, Mar 21 2011
Moebius transform is length 3 sequence [-1, 0, 3]. - Michael Somos, Mar 22 2011
a(n) = -b(n) where b(n) = A061347(n) is multiplicative with b(3^e) = -2 if e > 0, b(p^e) = 1 otherwise. - Michael Somos, Jan 19 2012
a(n) = a(-n). a(n) = c_3(n) if n > 1 where c_k(n) is Ramanujan's sum. - Michael Somos, Mar 21 2011
G.f.: (1 - x) * (1 - x^2) / (1 - x^3). a(n) = -a(n-1) - a(n-2) unless n = 0, 1, 2. - Michael Somos, Jan 19 2012
Dirichlet g.f.: Sum_{n>=1} a(n)/n^s = zeta(s)*(3^(1-s)-1). - R. J. Mathar, Apr 11 2011
a(n+3) = R(n,-1) for n >= 0, with the monic Chebyshev T-polynomials R with coefficient table A127672. - Wolfdieter Lang, Feb 27 2014
For n > 0, a(n) = 2*cos(n*Pi/3)*cos(n*Pi). - Wesley Ivan Hurt, Sep 25 2017
From Peter Bala, Apr 20 2024: (Start)
a(n) is equal to the n-th order Taylor polynomial (centered at 0) of 1/c(x)^(2*n) evaluated at x = 1, where c(x) = (1 - sqrt(1 - 4*x))/(2*x) is the o.g.f. of the Catalan numbers A000108. Cf. A333093.
Row sums of the Riordan array A110162. (End)
Comments