A176742 Expansion of (1 - x^2) / (1 + x^2) in powers of x.
1, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2
Offset: 0
Examples
G.f. = 1 - 2*x^2 + 2*x^4 - 2*x^6 + 2*x^8 - 2*x^10 + 2*x^12 - 2*x^14 + 2*x^16 + ... The bipartite graphs Tz(n) (n>=1) look like |, |X|, |XX|, |XXX|, ... For n>=2 the lines have to be connected to give the 2*n nodes and 2*n edges. The n=1 graph Tz(1) has 2*1=2 nodes and only one edge. n=1: determinant((1))=1; n=2: determinant(Matrix([[1,1],[1,1]]))=0; n=3: determinant(Matrix([[1,1,0],[1,0,1],[0,1,1]]))=-2; n=4: determinant(Tz(4))=0; etc.
Links
- Wolfdieter Lang, Some Tz(n) graphs and matrices.
- Rothaus Tannenzäpfle, Tz(4) graph on the Tannenzäpfle logo
- Index entries for linear recurrences with constant coefficients, signature (0,-1).
Programs
-
Maple
a := n -> 2^signum(n)*(-1)^iquo(n+1,2)*modp(n+1,2); seq(a(n), n=0..100); # Peter Luschny, Jun 22 2014
-
Mathematica
Join[{1}, Table[{0, -2, 0, 2}, {26}]] // Flatten (* Jean-François Alcover, Jun 21 2013 *) a[ n_] := - Boole[n == 0] + {0, -2, 0, 2}[[Mod[ n, 4, 1]]]; (* Michael Somos, May 05 2015 *) PadRight[{1},120,{2,0,-2,0}] (* Harvey P. Dale, Apr 13 2019 *)
-
PARI
{a(n) = - (n == 0) + [2, 0, -2, 0][n%4 + 1]}; /* Michael Somos, Mar 21 2011 */
-
Python
def A176742(n): return (2,0,-2,0)[n&3] if n else 1 # Chai Wah Wu, Apr 22 2025
Formula
Euler transform of length 4 sequence [0, -2, 0, 1]. - Michael Somos, Mar 21 2011
Moebius transform is length 4 sequence [0, -2, 0, 4]. - Michael Somos, Mar 22 2011
a(n) = a(-n) for all n in Z. a(n) = c_4(n) if n>1, where c_k(n) is Ramanujan's sum. - Michael Somos, Mar 21 2011
a(n-1) := determinant(Tz(n)), n>=1. The rows of the matrix Tz(4) are [[1, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 1]]. Tz(1)=(1), and Tz(2) has rows [[1, 1], [1, 1]]. The matrix for the generalization Tz(n) has rows [[1,1,0,...,0], [1,0,1,0,...,0], [0,1,0,1,0,...,0], ..., [0,...,0,1,0,1], [0,...,0,1,1].
a(0)=1, a(2*k-1)= 0, a(4*k) = +2, a(4*k-2) = -2, k>=1.
O.g.f.: (1-x^2)/(1+x^2).
Dirichlet g.f. sum_{n>=1} a(n)/n^s = zeta(s)*(4^(1-s)-2^(1-s)). - R. J. Mathar, Apr 11 2011
a(n) = (((n+1) mod 2)+((n+2+sign(n)) mod 2))*(-1)^ceiling(n/2). - Wesley Ivan Hurt, Jun 20 2014
Comments