cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 34 results. Next

A056594 Period 4: repeat [1,0,-1,0]; expansion of 1/(1 + x^2).

Original entry on oeis.org

1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0
Offset: 0

Views

Author

Wolfdieter Lang, Aug 04 2000

Keywords

Comments

G.f. is inverse of cyclotomic(4,x). Unsigned: A000035(n+1).
Real part of i^n and imaginary part of i^(n+1), i=sqrt(-1). - Reinhard Zumkeller, Jul 22 2007
The BINOMIAL transform generates A009116(n); the inverse BINOMIAL transform generates (-1)^n*A009116(n). - R. J. Mathar, Apr 07 2008
a(n-1), n >= 1, is the nontrivial Dirichlet character modulo 4, called Chi_2(4;n) (the trivial one is Chi_1(4;n) given by periodic(1,0) = A000035(n)). See the Apostol reference, p. 139, the k = 4, phi(k) = 2 table. - Wolfdieter Lang, Jun 21 2011
a(n-1), n >= 1, is the character of the Dirichlet beta function. - Daniel Forgues, Sep 15 2012
a(n-1), n >= 1, is also the (strongly) multiplicative function h(n) of Theorem 5.12, p. 150, of the Niven-Zuckerman reference. See the formula section. This function h(n) can be employed to count the integer solutions to n = x^2 + y^2. See A002654 for a comment with the formula. - Wolfdieter Lang, Apr 19 2013
This sequence is duplicated in A101455 but with offset 1. - Gary Detlefs, Oct 04 2013
For n >= 2 this gives the determinant of the bipartite graph with 2*n nodes and the adjacency matrix A(n) with elements A(n;1,2) = 1 = A(n;n,n-1), and for 1 < i < n A(n;i,i+1) = 1 = A(n;i,i-1), otherwise 0. - Wolfdieter Lang, Jun 25 2023

Examples

			With a(n-1) = h(n) of Niven-Zuckerman: a(62) = h(63) = h(3^2*7^1) = (-1)^(2*1)*(-1)^(1*3) = -1 = h(3)^2*h(7) = a(2)^2*a(6) = (-1)^2*(-1) = -1. - _Wolfdieter Lang_, Apr 19 2013
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1986.
  • I. S. Gradstein and I. M. Ryshik, Tables of series, products, and integrals, Volume 1, Verlag Harri Deutsch, 1981.
  • Ivan Niven and Herbert S. Zuckerman, An Introduction to the Theory of Numbers, New York: John Wiley (1980), p. 150.
  • Jerome Spanier and Keith B. Oldham, "Atlas of Functions", Hemisphere Publishing Corp., 1987, chapter 32, equation 32:6:1 at page 300.

Crossrefs

Cf. A049310, A074661, A131852, A002654, A146559 (binomial transform).

Programs

  • Magma
    &cat[ [1, 0, -1, 0]: n in [0..23] ]; // Bruno Berselli, Feb 08 2011
    
  • Maple
    A056594 := n->(1-irem(n,2))*(-1)^iquo(n,2); # Peter Luschny, Jul 27 2011
  • Mathematica
    CoefficientList[Series[1/(1 + x^2), {x, 0, 50}], x]
    a[n_]:= KroneckerSymbol[-4,n+1];Table[a[n],{n,0,93}] (* Thanks to Jean-François Alcover. - Wolfdieter Lang, May 31 2013 *)
    CoefficientList[Series[1/Cyclotomic[4, x], {x, 0, 100}], x] (* Vincenzo Librandi, Apr 03 2014 *)
  • Maxima
    A056594(n) := block(
            [1,0,-1,0][1+mod(n,4)]
    )$ /* R. J. Mathar, Mar 19 2012 */
    
  • PARI
    {a(n) = real( I^n )}
    
  • PARI
    {a(n) = kronecker(-4, n+1) }
    
  • Python
    def A056594(n): return (1,0,-1,0)[n&3] # Chai Wah Wu, Sep 23 2023

Formula

G.f.: 1/(1+x^2).
E.g.f.: cos(x).
a(n) = (1/2)*((-i)^n + i^n), where i = sqrt(-1). - Mitch Harris, Apr 19 2005
a(n) = (1/2)*((-1)^(n+floor(n/2)) + (-1)^floor(n/2)).
Recurrence: a(n)=a(n-4), a(0)=1, a(1)=0, a(2)=-1, a(3)=0.
a(n) = T(n, 0) = A053120(n, 0); T(n, x) Chebyshev polynomials of the first kind. - Wolfdieter Lang, Aug 21 2009
a(n) = S(n, 0) = A049310(n, 0); S(n, x) := U(n, x/2), Chebyshev polynomials of 2nd kind.
Sum_{k>=0} a(k)/(k+1) = Pi/4. - Jaume Oliver Lafont, Mar 30 2010
a(n) = Sum_{k=0..n} A101950(n,k)*(-1)^k. - Philippe Deléham, Feb 10 2012
a(n) = (1/2)*(1 + (-1)^n)*(-1)^(n/2). - Bruno Berselli, Mar 13 2012
a(0) = 1, a(n-1) = 0 if n is even, a(n-1) = Product_{j=1..m} (-1)^(e_j*(p_j-1)/2) if the odd n-1 = p_1^(e_1)*p_2^(e_2)*...*p_m^(e_m) with distinct odd primes p_j, j=1..m. See the function h(n) of Theorem 5.12 of the Niven-Zuckerman reference. - Wolfdieter Lang, Apr 19 2013
a(n) = (-4/(n+1)), n >= 0, where (k/n) is the Kronecker symbol. See the Eric Weisstein and Wikipedia links. Thanks to Wesley Ivan Hurt. - Wolfdieter Lang, May 31 2013
a(n) = R(n,0)/2 with the row polynomials R of A127672. This follows from the product of the zeros of R, and the formula Product_{k=0..n-1} 2*cos((2*k+1)*Pi/(2*n)) = (1 + (-1)^n)*(-1)^(n/2), n >= 1 (see the Gradstein and Ryshik reference, p. 63, 1.396 4., with x = sqrt(-1)). - Wolfdieter Lang, Oct 21 2013
a(n) = Sum_{k=0..n} i^(k*(k+1)), where i=sqrt(-1). - Bruno Berselli, Mar 11 2015
Dirichlet g.f. of a(n) shifted right: L(chi_2(4),s) = beta(s) = (1-2^(-s))*(d.g.f. of A034947), see comments by Lang and Forgues. - Ralf Stephan, Mar 27 2015
a(n) = cos(3*n*Pi/2). - Ridouane Oudra, Sep 29 2024

A098158 Triangle T(n,k) with diagonals T(n,n-k) = binomial(n, 2*k).

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 0, 3, 1, 0, 0, 1, 6, 1, 0, 0, 0, 5, 10, 1, 0, 0, 0, 1, 15, 15, 1, 0, 0, 0, 0, 7, 35, 21, 1, 0, 0, 0, 0, 1, 28, 70, 28, 1, 0, 0, 0, 0, 0, 9, 84, 126, 36, 1, 0, 0, 0, 0, 0, 1, 45, 210, 210, 45, 1, 0, 0, 0, 0, 0, 0, 11, 165, 462, 330, 55, 1, 0, 0, 0, 0, 0, 0, 1, 66, 495, 924
Offset: 0

Views

Author

Paul Barry, Aug 29 2004

Keywords

Comments

Row sums are A011782. Inverse is A065547.
Triangle T(n,k), 0 <= k <= n, read by rows, given by [0, 1, -1, 0, 0, 0, 0, 0, ...] DELTA [1, 0, 1, 0, 0, 0, 0, 0, ...] where DELTA is the operator defined in A084938. - Philippe Deléham, Jul 29 2006
Sum of entries in column k is A001519(k+1) (the odd-indexed Fibonacci numbers). - Philippe Deléham, Dec 02 2008
Number of permutations of length n avoiding simultaneously the patterns 123 and 132 with k left-to-right minima. A left-to-right minimum in a permutation a(1)a(2)...a(n) is position i such that a(j) > a(i) for all j < i. - Tian Han, Nov 16 2023

Examples

			Rows begin
  1;
  0, 1;
  0, 1, 1;
  0, 0, 3, 1;
  0, 0, 1, 6, 1;
		

Crossrefs

Cf. A119900. - Philippe Deléham, Dec 02 2008

Programs

  • GAP
    Flat(List([0..12], n-> List([0..n], k-> Binomial(n, 2*(n-k)) ))); # G. C. Greubel, Aug 01 2019
  • Magma
    [Binomial(n, 2*(n-k)): k in [0..n], n in [0..12]]; // G. C. Greubel, Aug 01 2019
    
  • Mathematica
    Table[Binomial[n, 2*(n-k)], {n,0,12}, {k,0,n}]//Flatten (* Michael De Vlieger, Oct 12 2016 *)
  • PARI
    {T(n,k)=polcoeff(polcoeff((1-x*y)/((1-x*y)^2-x^2*y)+x*O(x^n), n, x) + y*O(y^k),k,y)} (Hanna)
    
  • PARI
    T(n,k) = binomial(n, 2*(n-k));
    for(n=0,12, for(k=0,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Aug 01 2019
    
  • Sage
    [[binomial(n, 2*(n-k)) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Aug 01 2019
    

Formula

T(n,k) = binomial(n,2*(n-k)).
From Tom Copeland, Oct 10 2016: (Start)
E.g.f.: exp(t*x) * cosh(t*sqrt(x)).
O.g.f.: (1/2) * ( 1 / (1 - (1 + sqrt(1/x))*x*t) + 1 / (1 - (1 - sqrt(1/x))*x*t) ).
Row polynomial: x^n * ((1 + sqrt(1/x))^n + (1 - sqrt(1/x))^n) / 2. (End)
Column k is generated by the polynomial Sum_{j=0..floor(k/2)} C(k, 2j) * x^(k-j). - Paul Barry, Jan 22 2005
G.f.: (1-x*y)/((1-x*y)^2 - x^2*y). - Paul D. Hanna, Feb 25 2005
Sum_{k=0..n} x^k*T(n,k)= A009116(n), A000007(n), A011782(n), A006012(n), A083881(n), A081335(n), A090139(n), A145301(n), A145302(n), A145303(n), A143079(n) for x = -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 respectively. - Philippe Deléham, Dec 04 2006, Oct 15 2008, Oct 19 2008
T(n,k) = T(n-1,k-1) + Sum_{i=0..k-1} T(n-2-i,k-1-i); T(0,0)=1; T(n,k)=0 if n < 0 or k < 0 or n < k. E.g.: T(8,5) = T(7,4) + T(6,4) + T(5,3) + T(4,2) + T(3,1) + T(2,0) = 7+15+5+1+0+0 = 28. - Philippe Deléham, Dec 04 2006
Sum_{k=0..n} T(n,k)*x^(n-k) = A000012(n), A011782(n), A001333(n), A026150(n), A046717(n), A084057(n), A002533(n), A083098(n), A084058(n), A003665(n), A002535(n), A133294(n), A090042(n), A125816(n), A133343(n), A133345(n), A120612(n), A133356(n), A125818(n) for x = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 respectively. - Philippe Deléham, Dec 24 2007
Sum_{k=0..n} T(n,k)*(-x)^(n-k) = A000012(n), A146559(n), A087455(n), A138230(n), A006495(n), A138229(n) for x = 0,1,2,3,4,5 respectively. - Philippe Deléham, Nov 14 2008
T(n,k) = A085478(k,n-k). - Philippe Deléham, Dec 02 2008
T(n,k) = 2*T(n-1,k-1) + T(n-2,k-1) - T(n-2,k-2), T(0,0) = T(1,1) = 1, T(1,0) = 0 and T(n,k) = 0 if k < 0 or if k > n. - Philippe Deléham, Mar 15 2012

A101455 a(n) = 0 for even n, a(n) = (-1)^((n-1)/2) for odd n. Periodic sequence 1,0,-1,0,...

Original entry on oeis.org

0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0
Offset: 0

Views

Author

Gerald McGarvey, Jan 20 2005

Keywords

Comments

Called X(n) (i.e., Chi(n)) in Hardy and Wright (p. 241), who show that X(n*m) = X(n)*X(m) for all n and m (i.e., X(n) is completely multiplicative) since (n*m - 1)/2 - (n - 1)/2 - (m - 1)/2 = (n - 1)*(m - 1)/2 == 0 (mod 2) when n and m are odd.
Same as A056594 but with offset 1.
From R. J. Mathar, Jul 15 2010: (Start)
The sequence is the non-principal Dirichlet character mod 4. (The principal character is A000035.)
Associated Dirichlet L-functions are for example L(1,chi) = Sum_{n>=1} a(n)/n = A003881, or L(2,chi) = Sum_{n>=1} a(n)/n^2 = A006752, or L(3,chi) = Sum_{n>=1} a(n)/n^3 = A153071. (End)
a(n) is a strong elliptic divisibility sequence t_n as given in [Kimberling, p. 16] where x = 0, y = -1, z is arbitrary. - Michael Somos, Nov 27 2019

Examples

			G.f. = x - x^3 + x^5 - x^7 + x^9 - x^11 + x^13 - x^15 + x^17 - x^19 + x^21 + ...
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1986, page 139, k=4, Chi_2(n).
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 5th ed., Oxford Univ. Press, 1979, p. 241.

Crossrefs

Kronecker symbols {(d/n)} where d is a fundamental discriminant with |d| <= 24: A109017 (d=-24), A011586 (d=-23), A289741 (d=-20), A011585 (d=-19), A316569 (d=-15), A011582 (d=-11), A188510 (d=-8), A175629 (d=-7), this sequence (d=-4), A102283 (d=-3), A080891 (d=5), A091337 (d=8), A110161 (d=12), A011583 (d=13), A011584 (d=17), A322829 (d=21), A322796 (d=24).

Programs

  • GAP
    a := [1, 0];; for n in [3..10^2] do a[n] := a[n-2]; od; a; # Muniru A Asiru, Feb 02 2018
    
  • Magma
    m:=75; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(x/(1+x^2))); // G. C. Greubel, Aug 23 2018
    
  • Maple
    a := n -> `if`(n mod 2=0, 0, (-1)^((n-1)/2)):
    seq(a(n), n=1..10^3); # Muniru A Asiru, Feb 02 2018
  • Mathematica
    a[ n_] := {1, 0, -1, 0}[[ Mod[ n, 4, 1]]]; (* Michael Somos, Jan 13 2014 *)
    LinearRecurrence[{0, -1}, {1, 0}, 75] (* G. C. Greubel, Aug 23 2018 *)
  • PARI
    {a(n) = if( n%2, (-1)^(n\2))}; /* Michael Somos, Sep 02 2005 */
    
  • PARI
    {a(n) = kronecker( -4, n)}; /* Michael Somos, Mar 30 2012 */
    
  • Python
    def A101455(n): return (0,1,0,-1)[n&3] # Chai Wah Wu, Jun 21 2024

Formula

Multiplicative with a(2^e) = 0, a(p^e) = (-1)^((p^e-1)/2) otherwise. - Mitch Harris May 17 2005
Euler transform of length 4 sequence [0, -1, 0, 1]. - Michael Somos, Sep 02 2005
G.f.: (x - x^3)/(1 - x^4) = x/(1 + x^2). - Michael Somos, Sep 02 2005
G.f. A(x) satisfies: 0 = f(A(x), A(x^2)) where f(u, v) = v - u^2 * (1 + 2*v). - Michael Somos, Aug 04 2011
a(n + 4) = a(n), a(n + 2) = a(-n) = -a(n), a(2*n) = 0, a(2*n + 1) = (-1)^n for all n in Z. - Michael Somos, Aug 04 2011
a(n + 1) = A056594(n). - Michael Somos, Jan 13 2014
REVERT transform is A126120. STIRLING transform of A009454. BINOMIAL transform is A146559. BINOMIAL transform of A009116. BIN1 transform is A108520. MOBIUS transform of A002654. EULER transform is A111335. - Michael Somos, Mar 30 2012
Completely multiplicative with a(p) = 2 - (p mod 4). - Werner Schulte, Feb 01 2018
a(n) = (-(n mod 2))^binomial(n, 2). - Peter Luschny, Sep 08 2018
a(n) = sin(n*Pi/2) = Im(i^n) where i is the imaginary unit. - Jianing Song, Sep 09 2018
From Jianing Song, Nov 14 2018: (Start)
a(n) = ((-4)/n) (or more generally, ((-4^i)/n) for i > 0), where (k/n) is the Kronecker symbol.
E.g.f.: sin(x).
Dirichlet g.f. is the Dirichlet beta function.
a(n) = A091337(n)*A188510(n). (End)

Extensions

a(0) prepended by Jianing Song, Nov 14 2024

A009545 Expansion of e.g.f. sin(x)*exp(x).

Original entry on oeis.org

0, 1, 2, 2, 0, -4, -8, -8, 0, 16, 32, 32, 0, -64, -128, -128, 0, 256, 512, 512, 0, -1024, -2048, -2048, 0, 4096, 8192, 8192, 0, -16384, -32768, -32768, 0, 65536, 131072, 131072, 0, -262144, -524288, -524288, 0, 1048576, 2097152, 2097152, 0, -4194304, -8388608, -8388608, 0, 16777216, 33554432
Offset: 0

Views

Author

Keywords

Comments

Also first of the two associated sequences a(n) and b(n) built from a(0)=0 and b(0)=1 with the formulas a(n) = a(n-1) + b(n-1) and b(n) = -a(n-1) + b(n-1). The initial terms of the second sequence b(n) are 1, 1, 0, -2, -4, -4, 0, 8, 16, 16, 0, -32, -64, -64, 0, 128, 256, ... The points Mn(a(n)+b(n)*I) of the complex plane are located on the spiral logarithmic rho = 2*(1/2)^(2*theta)/Pi) and on the straight lines drawn from the origin with slopes: infinity, 1/2, 0, -1/2. - Philippe LALLOUET (philip.lallouet(AT)wanadoo.fr), Jun 30 2007
A000225: (1, 3, 7, 15, 31, ...) = 2^n - 1 = INVERT transform of A009545 starting (1, 2, 2, 0, -4, -8, ...). (Cf. comments in A144081). - Gary W. Adamson, Sep 10 2008
Pisano period lengths: 1, 1, 8, 1, 4, 8, 24, 1, 24, 4, 40, 8, 12, 24, 8, 1, 16, 24, 72, 4, ... - R. J. Mathar, Aug 10 2012
The variant 0, 1, -2, 2, 0, -4, 8, -8, 0, 16, -32, 32, 0, -64, (with different signs) is the Lucas U(-2,2) sequence. - R. J. Mathar, Jan 08 2013
(1+i)^n = A146559(n) + a(n)*i where i = sqrt(-1). - Philippe Deléham, Feb 13 2013
This is the Lucas U(2,2) sequence. - Raphie Frank, Nov 28 2015
{A146559, A009545} are the difference analogs of {cos(x),sin(x)} (cf. [Shevelev] link). - Vladimir Shevelev, Jun 08 2017

Crossrefs

Cf. A009116. For minor variants of this sequence see A108520, A084102, A099087.
a(2*n) = A056594(n)*2^n, n >= 1, a(2*n+1) = A057077(n)*2^n.
This is the next term in the sequence A015518, A002605, A000129, A000079, A001477.
Cf. A000225, A144081. - Gary W. Adamson, Sep 10 2008
Cf. A146559.

Programs

  • Magma
    I:=[0,1,2,2]; [n le 4 select I[n] else -4*Self(n-4): n in [1..60]]; // Vincenzo Librandi, Nov 29 2015
    
  • Maple
    t1 := sum(n*x^n, n=0..100): F := series(t1/(1+x*t1), x, 100): for i from 0 to 50 do printf(`%d, `, coeff(F, x, i)) od: # Zerinvary Lajos, Mar 22 2009
    G(x):=exp(x)*sin(x): f[0]:=G(x): for n from 1 to 54 do f[n]:=diff(f[n-1],x) od: x:=0: seq(f[n],n=0..50 ); # Zerinvary Lajos, Apr 05 2009
    A009545 := n -> `if`(n<2, n, 2^(n-1)*hypergeom([1-n/2, (1-n)/2], [1-n], 2)):
    seq(simplify(A009545(n)), n=0..50); # Peter Luschny, Dec 17 2015
  • Mathematica
    nn=104; Range[0,nn-1]! CoefficientList[Series[Sin[x]Exp[x], {x,0,nn}], x] (* T. D. Noe, May 26 2007 *)
    Join[{a=0,b=1},Table[c=2*b-2*a;a=b;b=c,{n,100}]] (* Vladimir Joseph Stephan Orlovsky, Jan 17 2011 *)
    f[n_] := (1 + I)^(n - 2) + (1 - I)^(n - 2); Array[f, 51, 0] (* Robert G. Wilson v, May 30 2011 *)
    LinearRecurrence[{2,-2},{0,1},110] (* Harvey P. Dale, Oct 13 2011 *)
  • PARI
    x='x+O('x^66); Vec(serlaplace(exp(x)*sin(x))) /* Joerg Arndt, Apr 24 2011 */
    
  • PARI
    x='x+O('x^100); concat(0, Vec(x/(1-2*x+2*x^2))) \\ Altug Alkan, Dec 04 2015
    
  • Python
    def A009545(n): return ((0, 1, 2, 2)[n&3]<<((n>>1)&-2))*(-1 if n&4 else 1) # Chai Wah Wu, Feb 16 2024
  • Sage
    [lucas_number1(n,2,2) for n in range(0, 51)] # Zerinvary Lajos, Apr 23 2009
    
  • Sage
    def A146559():
        x, y = 0, -1
        while True:
            yield x
            x, y = x - y, x + y
    a = A146559(); [next(a) for i in range(40)]  # Peter Luschny, Jul 11 2013
    

Formula

a(0)=0; a(1)=1; a(2)=2; a(3)=2; a(n) = -4*a(n-4), n>3. - Larry Reeves (larryr(AT)acm.org), Aug 24 2000
Imaginary part of (1+i)^n. - Marc LeBrun
G.f.: x/(1 - 2*x + 2*x^2).
E.g.f.: sin(x)*exp(x).
a(n) = S(n-1, sqrt(2))*(sqrt(2))^(n-1) with S(n, x)= U(n, x/2) Chebyshev's polynomials of the 2nd kind, Cf. A049310, S(-1, x) := 0.
a(n) = ((1+i)^n - (1-i)^n)/(2*i) = 2*a(n-1) - 2*a(n-2) (with a(0)=0 and a(1)=1). - Henry Bottomley, May 10 2001
a(n) = (1+i)^(n-2) + (1-i)^(n-2). - Benoit Cloitre, Oct 28 2002
a(n) = Sum_{k=0..n-1} (-1)^floor(k/2)*binomial(n-1, k). - Benoit Cloitre, Jan 31 2003
a(n) = 2^(n/2)sin(Pi*n/4). - Paul Barry, Sep 17 2003
a(n) = Sum_{k=0..floor(n/2)} binomial(n, 2*k+1)*(-1)^k. - Paul Barry, Sep 20 2003
a(n+1) = Sum_{k=0..n} 2^k*A109466(n,k). - Philippe Deléham, Nov 13 2006
a(n) = 2*((1/2)^(2*theta(n)/Pi))*cos(theta(n)) where theta(4*p+1) = p*Pi + Pi/2, theta(4*p+2) = p*Pi + Pi/4, theta(4*p+3) = p*Pi - Pi/4, theta(4*p+4) = p*Pi - Pi/2, or a(0)=0, a(1)=1, a(2)=2, a(3)=2, and for n>3 a(n)=-4*a(n-4). Same formulas for the second sequence replacing cosines with sines. For example: a(0) = 0, b(0) = 1; a(1) = 0+1 = 1, b(1) = -0+1 = 1; a(2) = 1+1 = 2, b(2) = -1+1 = 0; a(3) = 2+0 = 2, b(3) = -2+0 = -2. - Philippe LALLOUET (philip.lallouet(AT)wanadoo.fr), Jun 30 2007
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3), n > 3, which implies the sequence is identical to its fourth differences. Binomial transform of 0, 1, 0, -1. - Paul Curtz, Dec 21 2007
Logarithm g.f. arctan(x/(1-x)) = Sum_{n>0} a(n)/n*x^n. - Vladimir Kruchinin, Aug 11 2010
a(n) = A046978(n) * A016116(n). - Paul Curtz, Apr 24 2011
E.g.f.: exp(x) * sin(x) = x + x^2/(G(0)-x); G(k) = 2k + 1 + x - x*(2k+1)/(4k+3+x+x^2*(4k+3)/( (2k+2)*(4k+5) - x^2 - x*(2k+2)*(4k+5)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Nov 15 2011
a(n) = Im( (1+i)^n ) where i=sqrt(-1). - Stanislav Sykora, Jun 11 2012
G.f.: x*U(0) where U(k) = 1 + x*(k+3) - x*(k+1)/U(k+1); (continued fraction, 1-step). - Sergei N. Gladkovskii, Oct 10 2012
G.f.: G(0)*x/(2*(1-x)), where G(k) = 1 + 1/(1 - x*(k+1)/(x*(k+2) + 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 25 2013
G.f.: x + x^2*W(0), where W(k) = 1 + 1/(1 - x*(k+1)/( x*(k+2) + 1/W(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 28 2013
G.f.: Q(0)*x/2, where Q(k) = 1 + 1/(1 - x*(4*k+2 - 2*x)/( x*(4*k+4 - 2*x) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Sep 06 2013
a(n) = (A^n - B^n)/(A - B), where A = 1 + i and B = 1 - i; A and B are solutions of x^2 - 2*x + 2 = 0. - Raphie Frank, Nov 28 2015
a(n) = 2^(n-1)*hypergeom([1-n/2, (1-n)/2], [1-n], 2) for n >= 2. - Peter Luschny, Dec 17 2015
a(k+m) = a(k)*A146559(m) + a(m)*A146559(k). - Vladimir Shevelev, Jun 08 2017

Extensions

Extended with signs by Olivier Gérard, Mar 15 1997
More terms from Larry Reeves (larryr(AT)acm.org), Aug 24 2000
Definition corrected by Joerg Arndt, Apr 24 2011

A146559 Expansion of (1-x)/(1 - 2*x + 2*x^2).

Original entry on oeis.org

1, 1, 0, -2, -4, -4, 0, 8, 16, 16, 0, -32, -64, -64, 0, 128, 256, 256, 0, -512, -1024, -1024, 0, 2048, 4096, 4096, 0, -8192, -16384, -16384, 0, 32768, 65536, 65536, 0, -131072, -262144, -262144, 0, 524288, 1048576, 1048576, 0, -2097152, -4194304
Offset: 0

Views

Author

Philippe Deléham, Nov 01 2008

Keywords

Comments

Partial sums of this sequence give A099087. - Philippe Deléham, Dec 01 2008
From Philippe Deléham, Feb 13 2013, Feb 20 2013: (Start)
Terms of the sequence lie along the right edge of the triangle
(1)
(1)
2 (0)
2 (-2)
4 0 (-4)
4 -4 (-4)
8 0 -8 (0)
8 -8 -8 (8)
16 0 -16 0 (16)
16 -16 -16 16 (16)
32 0 -32 0 32 (0)
32 -32 -32 32 32 (-32)
64 0 -64 0 64 0 (-64)
...
Row sums of triangle are in A104597.
(1+i)^n = a(n) + A009545(n)*i where i = sqrt(-1). (End)
From Tom Copeland, Nov 08 2014: (Start)
This array is a member of a Catalan family (A091867) related by compositions of C(x)= (1-sqrt(1-4*x))/2, an o.g.f. for the Catalan numbers A000108, its inverse Cinv(x) = x(1-x), and the special linear fractional (Möbius) transformation P(x,t) = x / (1+t*x) with inverse P(x,-t) in x.
O.g.f.: G(x) = P[P[Cinv(x),-1],-1] = P[Cinv(x),-2] = x*(1-x)/(1 - 2*x*(1-x)) = x*A146599(x).
Ginv(x) = C[P(x,2)] = (1 - sqrt(1-4*x/(1+2*x)))/2 = x*A126930(x).
G(-x) = -(x*(1+x) - 2*(x*(1+x))^2 + 2^2*(x*(1+x))^3 - ...), and so this array contains the -row sums of A030528 * Diag(1, (-2)^1, 2^2, (-2)^3, ...).
The inverse of -G(-x) is -C[-P(x,-2)]= (-1 + sqrt(1+4*x/(1-2*x)))/2, an o.g.f. for A210736 with a(0) set to zero there. (End)
{A146559, A009545} is the difference analog of {cos(x), sin(x)}. (Cf. the Shevelev link.) - Vladimir Shevelev, Jun 08 2017

Examples

			G.f. = 1 + x - 2*x^3 - 4*x^4 - 4*x^5 + 8*x^7 + 16*x^8 + 16*x^9 - 32*x^11 - 64*x^12 - ...
		

Crossrefs

Programs

  • Magma
    I:=[1,1,0]; [n le 3 select I[n] else 2*Self(n-1)-2*Self(n-2): n in [1..45]]; // Vincenzo Librandi, Nov 10 2014
    
  • Maple
    G(x):=exp(x)*cos(x): f[0]:=G(x): for n from 1 to 54 do f[n]:=diff(f[n-1],x) od: x:=0: seq(f[n],n=0..44 ); # Zerinvary Lajos, Apr 05 2009
    seq(2^(n/2)*cos(Pi*n/4), n=0..44); # Peter Luschny, Oct 09 2021
  • Mathematica
    CoefficientList[Series[(1-x)/(1-2x+2x^2),{x,0,50}],x] (* or *) LinearRecurrence[{2,-2},{1,1},50] (* Harvey P. Dale, Oct 13 2011 *)
  • PARI
    Vec((1-x)/(1-2*x+2*x^2)+O(x^99)) \\ Charles R Greathouse IV, Jan 11 2012
    
  • Python
    def A146559(n): return ((1, 1, 0, -2)[n&3]<<((n>>1)&-2))*(-1 if n&4 else 1) # Chai Wah Wu, Feb 16 2024
  • Sage
    def A146559():
        x, y = -1, 0
        while True:
            yield -x
            x, y = x - y, x + y
    a = A146559(); [next(a) for i in range(51)]  # Peter Luschny, Jul 11 2013
    
  • SageMath
    def A146559(n): return 2^(n/2)*chebyshev_T(n, 1/sqrt(2))
    [A146559(n) for n in range(51)] # G. C. Greubel, Apr 17 2023
    

Formula

a(0) = 1, a(1) = 1, a(n) = 2*a(n-1) - 2*a(n-2) for n>1.
a(n) = Sum_{k=0..n} A124182(n,k)*(-2)^(n-k).
a(n) = Sum_{k=0..n} A098158(n,k)*(-1)^(n-k). - Philippe Deléham, Nov 14 2008
a(n) = (-1)^n*A009116(n). - Philippe Deléham, Dec 01 2008
E.g.f.: exp(x)*cos(x). - Zerinvary Lajos, Apr 05 2009
E.g.f.: cos(x)*exp(x) = 1+x/(G(0)-x) where G(k)=4*k+1+x+(x^2)*(4*k+1)/((2*k+1)*(4*k+3)-(x^2)-x*(2*k+1)*(4*k+3)/( 2*k+2+x-x*(2*k+2)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Nov 26 2011
a(n) = Re( (1+i)^n ) where i=sqrt(-1). - Stanislav Sykora, Jun 11 2012
G.f.: 1 / (1 - x / (1 + x / (1 - 2*x))) = 1 + x / (1 + 2*x^2 / (1 - 2*x)). - Michael Somos, Jan 03 2013
G.f.: G(0)/2, where G(k)= 1 + 1/(1 - x*(k+1)/(x*(k+2) + 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 25 2013
a(m+k) = a(m)*a(k) - A009545(m)*A009545(k). - Vladimir Shevelev, Jun 08 2017
a(n) = 2^(n/2)*cos(Pi*n/4). - Peter Luschny, Oct 09 2021
a(n) = 2^(n/2)*ChebyshevT(n, 1/sqrt(2)). - G. C. Greubel, Apr 17 2023
From Chai Wah Wu, Feb 15 2024: (Start)
a(n) = Sum_{n=0..floor(n/2)} binomial(n,2j)*(-1)^j = A121625(n)/n^n.
a(n) = 0 if and only if n == 2 mod 4.
(End)

A163403 a(n) = 2*a(n-2) for n > 2; a(1) = 1, a(2) = 2.

Original entry on oeis.org

1, 2, 2, 4, 4, 8, 8, 16, 16, 32, 32, 64, 64, 128, 128, 256, 256, 512, 512, 1024, 1024, 2048, 2048, 4096, 4096, 8192, 8192, 16384, 16384, 32768, 32768, 65536, 65536, 131072, 131072, 262144, 262144, 524288, 524288, 1048576, 1048576, 2097152, 2097152
Offset: 1

Views

Author

Klaus Brockhaus, Jul 26 2009

Keywords

Comments

a(n+1) is the number of palindromic words of length n using a two-letter alphabet. - Michael Somos, Mar 20 2011

Examples

			x + 2*x^2 + 2*x^3 + 4*x^4 + 4*x^5 + 8*x^6 + 8*x^7 + 16*x^8 + 16*x^9 + 32*x^10 + ...
		

Crossrefs

Equals A016116 without initial 1. Unsigned version of A152166.
Partial sums are in A136252.
Binomial transform is A078057, second binomial transform is A007070, third binomial transform is A102285, fourth binomial transform is A163350, fifth binomial transform is A163346.
Cf. A000079 (powers of 2), A009116, A009545, A051032.
The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A029744 = {s(n), n>=1}, the numbers 2^k and 3*2^k, as the parent: A029744 (s(n)); A052955 (s(n)-1), A027383 (s(n)-2), A354788 (s(n)-3), A347789 (s(n)-4), A209721 (s(n)+1), A209722 (s(n)+2), A343177 (s(n)+3), A209723 (s(n)+4); A060482, A136252 (minor differences from A354788 at the start); A354785 (3*s(n)), A354789 (3*s(n)-7). The first differences of A029744 are 1,1,1,2,2,4,4,8,8,... which essentially matches eight sequences: A016116, A060546, A117575, A131572, A152166, A158780, A163403, A320770. The bisections of A029744 are A000079 and A007283. - N. J. A. Sloane, Jul 14 2022

Programs

  • Magma
    [ n le 2 select n else 2*Self(n-2): n in [1..43] ];
    
  • Mathematica
    LinearRecurrence[{0, 2}, {1, 2}, 50] (* Paolo Xausa, Feb 02 2024 *)
  • PARI
    {a(n) = if( n<1, 0, 2^(n\2))} /* Michael Somos, Mar 20 2011 */
    
  • Sage
    def A163403():
        x, y = 1, 1
        while True:
            yield x
            x, y = x + y, x - y
    a = A163403(); [next(a) for i in range(40)]  # Peter Luschny, Jul 11 2013

Formula

a(n) = 2^((1/4)*(2*n - 1 + (-1)^n)).
G.f.: x*(1 + 2*x)/(1 - 2*x^2).
a(n) = A051032(n) - 1.
G.f.: x / (1 - 2*x / (1 + x / (1 + x))) = x * (1 + 2*x / (1 - x / (1 - x / (1 + 2*x)))). - Michael Somos, Jan 03 2013
From R. J. Mathar, Aug 06 2009: (Start)
a(n) = A131572(n).
a(n) = A060546(n-1), n > 1. (End)
a(n+3) = a(n+2)*a(n+1)/a(n). - Reinhard Zumkeller, Mar 04 2011
a(n) = |A009116(n-1)| + |A009545(n-1)|. - Bruno Berselli, May 30 2011
E.g.f.: cosh(sqrt(2)*x) + sinh(sqrt(2)*x)/sqrt(2) - 1. - Stefano Spezia, Feb 05 2023

A099087 Expansion of 1/(1 - 2*x + 2*x^2).

Original entry on oeis.org

1, 2, 2, 0, -4, -8, -8, 0, 16, 32, 32, 0, -64, -128, -128, 0, 256, 512, 512, 0, -1024, -2048, -2048, 0, 4096, 8192, 8192, 0, -16384, -32768, -32768, 0, 65536, 131072, 131072, 0, -262144, -524288, -524288, 0, 1048576, 2097152, 2097152, 0, -4194304, -8388608, -8388608, 0, 16777216
Offset: 0

Views

Author

Paul Barry, Sep 24 2004

Keywords

Comments

Yet another variation on A009545.
Row sums of Krawtchouk triangle A098593. Partial sums of e.g.f. exp(x)cos(x), or 2^(n/2)cos(Pi*n/2). See A009116.
Binomial transform of A057077. - R. J. Mathar, Nov 04 2008
Partial sums of A146559. - Philippe Deléham, Dec 01 2008
Pisano period lengths: 1, 1, 8, 1, 4, 8, 24, 1, 24, 4, 40, 8, 12, 24, 8, 1, 16, 24, 72, 4, ... - R. J. Mathar, Aug 10 2012
Also the inverse Catalan transform of A000079. - Arkadiusz Wesolowski, Oct 26 2012

Crossrefs

Programs

  • GAP
    a:=[1,2];; for n in [3..50] do a[n]:=2*a[n-1]-2*a[n-2]; od; a; # G. C. Greubel, Mar 16 2019
  • Magma
    I:=[1,2]; [n le 2 select I[n] else 2*(Self(n-1) - Self(n-2)): n in [1..50]]; // G. C. Greubel, Mar 16 2019
    
  • Mathematica
    CoefficientList[Series[1/(1 -2x +2x^2), {x, 0, 50}], x] (* Michael De Vlieger, Dec 24 2015 *)
  • PARI
    x='x+O('x^50); Vec(1/(1-2*x+2*x^2)) \\ Altug Alkan, Dec 24 2015
    
  • Sage
    [lucas_number1(n,2,2) for n in range(1, 50)] # Zerinvary Lajos, Apr 23 2009
    

Formula

E.g.f.: exp(x)*(cos(x) + sin(x)).
a(n) = 2^(n/2)*(cos(Pi*n/4) + sin(Pi*n/4)).
a(n) = Sum_{k=0..n} Sum_{i=0..k} binomial(n-k, k-i)*binomial(n, i) *(-1)^(k-i).
a(n) = 2*(a(n-1) - a(n-2)).
From R. J. Mathar, Apr 18 2008: (Start)
a(n) = (1-i)^(n-1) + (1+i)^(n-1) where i=sqrt(-1).
a(n) = 2 Sum_{k=0..(n-1)/2} (-1)^k*binomial(n-1,2k) if n>0. (End)
a(n) = Sum_{k=0..n} A109466(n,k)*2^k. - Philippe Deléham, Oct 28 2008
E.g.f.: (cos(x)+sin(x))*exp(x) = G(0); G(k)=1+2*x/(4*k+1-x*(4*k+1)/(2*(2*k+1)+x-2*(x^2)*(2*k+1)/((x^2)-(2*k+2)*(4*k+3)/G(k+1)))); (continued fraction). - Sergei N. Gladkovskii, Nov 26 2011
G.f.: U(0) where U(k)= 1 + x*(k+3) - x*(k+1)/U(k+1) ; (continued fraction, 1-step). - Sergei N. Gladkovskii, Oct 10 2012
a(n) = Re((1+i)^n) + Im((1+i)^n) where i = sqrt(-1) = A146559(n) + A009545(n). - Philippe Deléham, Feb 13 2013
a(n) = Sum_{j=0..n} binomial(n, j)*(-1)^binomial(j, 2); this is the case m=2 and z=-1 of f(m,n)(z) = Sum_{j=0..n} binomial(n, j)*z^binomial(j, m). See Dilcher and Ulas. - Michel Marcus, Sep 01 2020

Extensions

Signs added by N. J. A. Sloane, Nov 14 2006

A108520 Expansion of 1/(1+2*x+2*x^2).

Original entry on oeis.org

1, -2, 2, 0, -4, 8, -8, 0, 16, -32, 32, 0, -64, 128, -128, 0, 256, -512, 512, 0, -1024, 2048, -2048, 0, 4096, -8192, 8192, 0, -16384, 32768, -32768, 0, 65536, -131072, 131072, 0, -262144, 524288, -524288, 0, 1048576, -2097152, 2097152, 0, -4194304, 8388608, -8388608
Offset: 0

Views

Author

Michael Somos, Jun 07 2005

Keywords

Comments

Yet another variation on A009545.
Pisano period lengths: 1, 1, 8, 1, 4, 8, 24, 1, 24, 4, 40, 8, 12, 24, 8, 1, 16, 24, 72, 4, ... - R. J. Mathar, Aug 10 2012

Crossrefs

a(n) = (-1)^n * A099087(n). a(n) = -A084102(n) if n>0.

Programs

  • Magma
    [n le 2 select n*(-1)^(n-1) else -2*(Self(n-1)+Self(n-2)): n in [1..47]];  // Bruno Berselli, Apr 26 2011
    
  • Maple
    A108520 := n -> `if`(n=0, 1, (-2)^n*hypergeom([1/2-n/2, -n/2], [-n], 2)):
    seq(simplify(A108520(n)), n=0..46); # Peter Luschny, Dec 17 2015
  • Mathematica
    CoefficientList[Series[1/(1+2x+2x^2), {x,0,50}], x] (* or *) LinearRecurrence[{-2,-2}, {1,-2}, 50] (* Harvey P. Dale, Sep 30 2012 *)
    Table[-(-1-I)^(n-1) - (-1+I)^(n-1), {n, 0, 50}] (* Bruno Berselli, Nov 08 2015 *)
    Im[(-1+I)^Range[51]] (* G. C. Greubel, Apr 24 2023 *)
  • PARI
    a(n)=if(n<0, 0, polcoeff(1/(1+2*x+2*x^2)+x*O(x^n),n))
    
  • PARI
    a(n)=if(n<1, n==0, -polsym(2+2*x+x^2,n-1)[n])
    
  • PARI
    vector(66,n,imag((-1+I)^n)) /* Joerg Arndt, May 13 2011 */
    
  • SageMath
    [imag((-1+I)^(n+1)) for n in range(51)] # G. C. Greubel, Apr 24 2023

Formula

G.f.: 1/(1+2*x+2*x^2).
E.g.f.: exp(-x)*(cos(x) - sin(x)).
a(n) = -2*(a(n-1) + a(n-2)).
a(n) = Sum_{k=0..n} Sum_{j=0..n-k} C(k,j)*C(k,n-j)*(-2)^(n-j). - Paul Barry, Mar 09 2006
a(n) = -4 * a(n-4). - Paul Curtz, Apr 24 2011
a(n) = A016116(n+1) * A075553(n+1). - Paul Curtz, Apr 25 2011
From Bruno Berselli, Apr 26 2011: (Start)
a(n) = -(-1-i)^(n-1) - (-1+i)^(n-1), where i=sqrt(-1).
a(n) = -2*A009116(n-1) for n > 0. (End)
Imaginary part of (-1+i)^n, negated real part is A090132. - Joerg Arndt, May 13 2011
E.g.f.: (cos(x) - sin(x))*exp(-x) = G(0); G(k) = 1 - 2*x/(4*k+1+x*(4*k+1)/(2*(2*k+1) -x -2*(x^2)*(2*k+1)/((x^2) -(2*k+2)*(4*k+3)/G(k+1)))); (continued fraction). - Sergei N. Gladkovskii, Nov 26 2011
G.f.: G(0)/(2*(1+x)), where G(k) = 1 + 1/(1 - x*(k+1)/(x*(k+2) - 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 20 2013
a(n) = (-2)^n*hypergeom([1/2-n/2, -n/2], [-n], 2) for n >= 1. - Peter Luschny, Dec 17 2015

A038505 Sum of every 4th entry of row n in Pascal's triangle, starting at binomial(n,2).

Original entry on oeis.org

0, 0, 1, 3, 6, 10, 16, 28, 56, 120, 256, 528, 1056, 2080, 4096, 8128, 16256, 32640, 65536, 131328, 262656, 524800, 1048576, 2096128, 4192256, 8386560, 16777216, 33558528, 67117056, 134225920, 268435456, 536854528, 1073709056
Offset: 0

Views

Author

Keywords

Comments

Number of strings over Z_2 of length n with trace 0 and subtrace 1.
Same as number of strings over GF(2) of length n with trace 0 and subtrace 1.
Binomial transform of (0,1,1,0,0,1,1,0,...) gives a(n) for n >= 1. - Paul Barry, Jul 07 2003
From Gary W. Adamson, Mar 13 2009: (Start)
M^n * [1,0,0,0] = [A038503(n), A000749(n), a(n), A038504(n)]; where M = a 4 X 4 matrix [1,1,0,0; 0,1,1,0; 0,0,1,1; 1,0,0,1]. Sum of terms = 2^n.
Example: M^6 * [1,0,0,0] [16, 20, 16, 12]; sum = 2^6 = 64. (End)
{A038503, A038504, A038505, A000749} is the difference analog of the hyperbolic functions of order 4, {h_1(x), h_2(x), h_3(x), h_4(x)}. For a definition of {h_i(x)} and the difference analog {H_i (n)} see [Erdelyi] and the Shevelev link respectively. - Vladimir Shevelev, Jun 14 2017

Examples

			a(3; 0, 1) = 3 since the three binary strings of trace 0, subtrace 1 and length 3 are { 011, 101, 110 }.
		

References

  • A. Erdelyi, Higher Transcendental Functions, McGraw-Hill, 1955, Vol. 3, Chapter XVIII.

Crossrefs

Programs

  • GAP
    List([0..35],n->Sum([0..n],k->Binomial(n,2+4*k))); # Muniru A Asiru, Feb 21 2019
  • Haskell
    a038505 n = a038505_list !! n
    a038505_list = tail $ zipWith (-) (tail a000749_list) a000749_list
    -- Reinhard Zumkeller, Jul 15 2013
    
  • Magma
    I:=[0, 0, 1, 3]; [n le 3 select I[n] else 4*Self(n-1)-6*Self(n-2)+4*Self(n-3): n in [1..40]]; // Vincenzo Librandi, Jun 22 2012
    
  • Maple
    # From Peter Luschny, Jun 15 2017: (Start)
    s := sqrt(2): h := n -> [-2, -s, 0, s, 2, s, 0, -s][1 + (n mod 8)]:
    a := n -> `if`(n=0, 0, (2^n + 2^(n/2)*h(n))/4): seq(a(n), n=0..32);
    # Alternatively:
    egf := (1 + exp(2*x) - 2*exp(x)*cos(x))/4:
    series(egf, x, 33): seq(n!*coeff(%,x,n), n=0..32); # (End)
  • Mathematica
    LinearRecurrence[{4, -6, 4}, {0, 0, 1, 3}, 40] (* Vincenzo Librandi, Jun 22 2012 *)
    Table[If[n==0, 0, 2^(n-2) - 2^(n/2-1) Cos[Pi*n/4]], {n, 0, 32}] (* Vladimir Reshetnikov, Sep 16 2016 *)
  • Sage
    A = lambda n: (2^n - (1-I)^n - (1+I)^n) / 4 if n != 0 else 0
    print([A(n) for n in (0..32)]) # Peter Luschny, Jun 16 2017
    

Formula

a(n; t, s) = a(n-1; t, s) + a(n-1; t+1, s+t+1) where t is the trace and s is the subtrace.
a(n) = Sum_{k=0..n} binomial(n, 2 + 4*k), n >= 0.
a(n) = Sum_{k=0..n} (1/2)*C(n, k)*(-1)^C(k+3, 3) for n >= 1. - Paul Barry, Jul 07 2003
From Paul Barry, Nov 29 2004: (Start)
G.f.: x^2*(1-x)/((1-x)^4-x^4) = x^2*(1-x)/((1-2*x)*(1-2*x+2*x^2));
a(n) = Sum_{k=0..floor(n/2)} binomial(n, 2*k)*(1-(-1)^k)/2. (End)
Conjecture: 2*a(n+2) = A038504(n+2) + A000749(n+2) + 2*A009545(n). - Creighton Dement, May 22 2005
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3), n > 3; sequence is identical to its fourth differences. - Paul Curtz, Dec 21 2007
a(n) = A000749(n+1) - A000749(n). - Reinhard Zumkeller, Jul 15 2013
a(n+m) = a(n)*H_1(m) + H_2(n)*H_2(m) + H_1(n)*a(m) + H_4(n)*H_4(m),
where H_1=A038503, H_2=A038504, H_4=A000749. - Vladimir Shevelev, Jun 14 2017
From Peter Luschny, Jun 15 2017: (Start)
a(n) = n! [x^n] (1 + exp(2*x) - 2*exp(x)*cos(x))/4.
a(n) = A038503(n+2) - 2*A038503(n+1) + A038503(n).
a(n) = 2^(n-2) - A046980(n)*2^(A004525(n-3)) for n >= 1.
a(n) = (2^n - (1-i)^n - (1+i)^n) / 4 for n >= 1. Compare V. Shevelevs' formula (1) in A000749. (End)
From Vladimir Shevelev, Jun 16 2017: (Start)
Proof of the conjecture by Creighton Dement (May 22 2005): using the first formula of Theorem 1 in [Shevelev link] for n=4, omega=i=sqrt(-1), i:=1,2,3,4, m:=n>=1, we have
a(n) = (1/2)*(2^(n-1)-2^(n/2)*cos(Pi*n/4)), A038504(n) = (1/2)*(2^(n-1)+2^(n/2)* sin(Pi*n/4)), A000749(n) = (1/2)*(2^(n-1)-2^(n/2)*sin(Pi*n/4)). Finally we use the formula by Paul Barry: A009545(n) = 2^(n/2)*sin(Pi*n/4) = 2^(n/2)*(-cos(Pi*(n+2)/4)). Now it is easy to obtain the hypothetical formula. (End)

Extensions

Missing 0 prepended by Vladimir Shevelev, Jun 14 2017
Edited by Peter Luschny, Jun 16 2017

A066321 Binary representation of base-(i-1) expansion of n: replace i-1 with 2 in base-(i-1) expansion of n.

Original entry on oeis.org

0, 1, 12, 13, 464, 465, 476, 477, 448, 449, 460, 461, 272, 273, 284, 285, 256, 257, 268, 269, 3280, 3281, 3292, 3293, 3264, 3265, 3276, 3277, 3088, 3089, 3100, 3101, 3072, 3073, 3084, 3085, 3536, 3537, 3548, 3549, 3520, 3521, 3532, 3533, 3344, 3345, 3356
Offset: 0

Views

Author

Marc LeBrun, Dec 14 2001

Keywords

Comments

Here i = sqrt(-1).
First differences follow a strange period-16 pattern: 1 11 1 XXX 1 11 1 -29 1 11 1 -189 1 11 1 -29 where XXX is given by A066322. Number of one-bits is A066323.
From Andrey Zabolotskiy, Feb 06 2017: (Start)
(Observations.)
Actually, the sequence of the first differences can be split into blocks of size of any power of 2, and there will be only one position in the block that does not repeat. In this sense, one may say that the first differences follow (almost-)period-2^s pattern for any s > 0.
Specifically, the first differences are given by the formula: a(n+1)-a(n) = A282137(A007814((n xor ...110011001100) + 1)). Here binary representation of n is bitwise-xored with the period-4 bit sequence (A021913 written right-to-left) which is infinite or simply long enough; A007814(m) does not depend on the bits of m other than the least significant 1.
A282137 gives all first differences in the order of decreasing occurrence frequency.
(End)
Penney shows that since (i-1)^4 = -4, the representation a(n) of a real integer n is found by writing n in base -4 using digits 0 to 3 (A007608), changing those digits to bit strings 0000, 0001, 1100, 1101 respectively, and interpreting as binary. - Kevin Ryde, Sep 07 2019

Examples

			a(4) = 464 = 2^8 + 2^7 + 2^6 + 2^4 since (i-1)^8 + (i-1)^7 + (i-1)^6 + (i-1)^4 = 4.
		

References

  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, 1969, Vol. 2, p. 172. (See also exercise 16, p. 177; answer, p. 494.)

Crossrefs

See A271472 for the conversion of these decimal numbers to binary.
See A009116 and A009545 for real and imaginary parts of (i-1)^n (except for signs).
See A256441 for expansions of -n.

Programs

  • Maple
    f:= proc(n) option remember; local t,m;
       t:= n mod 4;
       procname(t) + 16*procname((t-n)/4)
    end proc:
    f(0):= 0: f(1):= 1: f(2):= 12: f(3):= 13:
    seq(f(i),i=0..100); # Robert Israel, Oct 21 2016
  • PARI
    a(n) = my(ret=0,p=0); while(n, ret+=[0,1,12,13][n%4+1]<Kevin Ryde, Sep 07 2019
  • Perl
    See Links section.
    
  • Python
    from gmpy2 import c_divmod
    u = ('0000','1000','0011','1011')
    def A066321(n):
        if n == 0:
            return 0
        else:
            s, q = '', n
            while q:
                q, r = c_divmod(q, -4)
                s += u[r]
            return int(s[::-1],2) # Chai Wah Wu, Apr 09 2016
    

Formula

In "rebase notation" a(n) = (i-1)[n]2.
G.f. g(z) satisfies g(z) = z*(1+12*z+13*z^2)/(1-z^4) + 16*z^4*(13+12*z^4+z^8)/((1-z)*(1+z^4)*(1+z^8)) + 256*(1-z^16)*g(z^16)/(z^12-z^13). - Robert Israel, Oct 21 2016
Showing 1-10 of 34 results. Next