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 20 results. Next

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

A009116 Expansion of e.g.f. cos(x) / exp(x).

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

Keywords

Comments

Apart from signs, generated by 1,1 position of H_2^n = [1,1;-1,1]^n; and a(n) = 2^(n/2)*cos(Pi*n/2). - Paul Barry, Feb 18 2004
Equals binomial transform of "Period 4, repeat [1, 0, -1, 0]". - Gary W. Adamson, Mar 25 2009
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

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

(With different signs) row sums of triangle A104597.
Also related to A066321 and A271472.

Programs

  • Magma
    R:=PowerSeriesRing(Rationals(), 50); Coefficients(R!(Laplace( Exp(-x)*Cos(x) ))); // G. C. Greubel, Jul 22 2018; Apr 17 2023
    
  • Maple
    A009116 := n->add((-1)^j*binomial(n,2*j),j=0..floor(n/2));
  • Mathematica
    n = 50; (* n = 2 mod 4 *) (CoefficientList[ Series[ Cos[x]/Exp[x], {x, 0, n}], x]* Table[k!, {k,0,n-1}] )[[1 ;; 45]] (* Jean-François Alcover, May 18 2011 *)
    Table[(1/2)*((-1-I)^n + (-1+I)^n), {n,0,50}] (* Jean-François Alcover, Jan 31 2018 *)
  • PARI
    {a(n) = if( n<0, 0, polcoeff( (1 + x) / (1 + 2*x + 2*x^2) + x * O(x^n), n))} /* Michael Somos, Nov 17 2002 */
    
  • SageMath
    def A009116(n): return 2^(n/2)*chebyshev_T(n, -1/sqrt(2))
    [A009116(n) for n in range(41)] # G. C. Greubel, Apr 17 2023

Formula

Real part of (-1-i)^n. See A009545 for imaginary part. - Marc LeBrun
a(n) = -2 * (a(n-1) + a(n-2)); a(0)=1, a(1)=-1. - Michael Somos, Nov 17 2002
G.f.: (1 + x) / (1 + 2*x + 2*x^2).
E.g.f.: cos(x) / exp(x).
a(n) = Sum_{k=0..n} (-1)^k*A098158(n,k). - Philippe Deléham, Dec 04 2006
a(n)*(-1)^n = A099087(n) - A099087(n-1). - R. J. Mathar, Nov 18 2007
a(n) = (-1)^n*A146559(n). - Philippe Deléham, Dec 01 2008
From Paul Curtz, Jul 22 2011: (Start)
a(n) = -4*a(n-4).
a(n) = A016116(n) * A075553(n+6). (End)
E.g.f.: cos(x)/exp(x) = 1 - x/(G(0)+1), where G(k) = 4k+1-x+(x^2)*(4k+1)/((2k+1)*(4k+3)-(x^2)+x*(2k+1)*(4k+3)/( 2k+2-x+x*(2k+2)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Nov 24 2011
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, Jun 20 2013
a(n) = (-1)^n*2^(n/2)*cos(n*Pi/4). - Nordine Fahssi, Dec 18 2013
a(n) = (-1)^floor((n+1)/2)*2^(n-1)*H(n, n mod 2, 1/2) for n >= 3 where H(n, a, b) = hypergeom([a - n/2, b - n/2], [1 - n], 2). - Peter Luschny, Sep 03 2019
a(n) = 2^(n/2)*ChebyshevT(n, -1/sqrt(2)). - G. C. Greubel, Apr 17 2023
a(n) = A108520(n-1)+A108520(n). - R. J. Mathar, May 09 2023

Extensions

Extended with signs by Olivier Gérard, Mar 15 1997
Definition corrected by Joerg Arndt, Apr 29 2011

A063967 Triangle read by rows, T(n,k) = T(n-1,k) + T(n-2,k) + T(n-1,k-1) + T(n-2,k-1) and T(0,0) = 1.

Original entry on oeis.org

1, 1, 1, 2, 3, 1, 3, 7, 5, 1, 5, 15, 16, 7, 1, 8, 30, 43, 29, 9, 1, 13, 58, 104, 95, 46, 11, 1, 21, 109, 235, 271, 179, 67, 13, 1, 34, 201, 506, 705, 591, 303, 92, 15, 1, 55, 365, 1051, 1717, 1746, 1140, 475, 121, 17, 1, 89, 655, 2123, 3979, 4759, 3780, 2010, 703, 154, 19, 1
Offset: 0

Views

Author

Henry Bottomley, Sep 05 2001

Keywords

Examples

			T(3,1) = T(2,1) + T(1,1) + T(2,0) + T(1,0) = 3 + 1 + 2 + 1 = 7.
Triangle begins:
   1,
   1,   1,
   2,   3,   1,
   3,   7,   5,   1,
   5,  15,  16,   7,   1,
   8,  30,  43,  29,   9,   1,
  13,  58, 104,  95,  46,  11,  1,
  21, 109, 235, 271, 179,  67, 13,  1,
  34, 201, 506, 705, 591, 303, 92, 15, 1
		

Crossrefs

Row sums are A002605.
Columns include: A000045(n+1), A023610(n-1).
Main diagonal: A000012, a(n, n-1) = A005408(n-1).
Matrix inverse: A091698, matrix square: A091700.
Cf. A321620.
Sum_{k=0..n} x^k*T(n,k) is (-1)^n*A057086(n) (x=-11), (-1)^n*A057085(n+1) (x=-10), (-1)^n*A057084(n) (x=-9), (-1)^n*A030240(n) (x=-8), (-1)^n*A030192(n) (x=-7), (-1)^n*A030191(n) (x=-6), (-1)^n*A001787(n+1) (x=-5), A000748(n) (x=-4), A108520(n) (x=-3), A049347(n) (x=-2), A000007(n) (x=-1), A000045(n) (x=0), A002605(n) (x=1), A030195(n+1) (x=2), A057087(n) (x=3), A057088(n) (x=4), A057089(n) (x=5), A057090(n) (x=6), A057091(n) (x=7), A057092(n) (x=8), A057093(n) (x=9). - Philippe Deléham, Nov 03 2006

Programs

  • Haskell
    a063967_tabl = [1] : [1,1] : f [1] [1,1] where
       f us vs = ws : f vs ws where
         ws = zipWith (+) ([0] ++ us ++ [0]) $
              zipWith (+) (us ++ [0,0]) $ zipWith (+) ([0] ++ vs) (vs ++ [0])
    -- Reinhard Zumkeller, Apr 17 2013
  • Mathematica
    T[n_, k_] := Sum[Binomial[j, n - j]*Binomial[j, k], {j, 0, n}]; Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Oct 11 2017, after Paul Barry *)
    (* Function RiordanSquare defined in A321620. *)
    RiordanSquare[1/(1 - x - x^2), 11] // Flatten (* Peter Luschny, Nov 27 2018 *)

Formula

G.f.: 1/(1-x*(1+x)*(1+y)). - Vladeta Jovovic, Oct 11 2003
Riordan array (1/(1-x-x^2), x(1+x)/(1-x-x^2)). The inverse of the signed version (1/(1+x-x^2),x(1-x)/(1+x-x^2)) is abs(A091698). - Paul Barry, Jun 10 2005
T(n, k) = Sum_{j=0..n} C(j, n-j)C(j, k). - Paul Barry, Nov 09 2005
Diagonal sums are A002478. - Paul Barry, Nov 09 2005
A026729*A007318 as infinite lower triangular matrices. - Philippe Deléham, Dec 11 2008
Central coefficients T(2*n,n) are A137644. - Paul Barry, Apr 15 2010
Product of Riordan arrays (1, x(1+x))*(1/(1-x), x/(1-x)), that is, A026729*A007318. - Paul Barry, Mar 14 2011
Triangle T(n,k), read by rows, given by (1,1,-1,0,0,0,0,0,0,0,...) DELTA (1,0,0,0,0,0,0,0,0,0,...) where DELTA is the operator defined in A084938. - Philippe Deléham, Nov 12 2011

A225883 a(n) = (-1)^n * (1 - 2^n).

Original entry on oeis.org

0, 1, -3, 7, -15, 31, -63, 127, -255, 511, -1023, 2047, -4095, 8191, -16383, 32767, -65535, 131071, -262143, 524287, -1048575, 2097151, -4194303, 8388607, -16777215, 33554431, -67108863, 134217727, -268435455, 536870911, -1073741823, 2147483647, -4294967295
Offset: 0

Views

Author

Michael Somos, May 19 2013

Keywords

Comments

A001047(n) = p(0) where p(x) is the unique degree-(n-1) polynomial such that p(k) = a(k) for k = 1, 2, ..., n.
a(n) = p(n) where p(x) is the unique degree-(n-1) polynomial such that p(k) = (-1)^k for k = 0, 1, ..., n-1.

Examples

			G.f. = x - 3*x^2 + 7*x^3 - 15*x^4 + 31*x^5 - 63*x^6 + 127*x^7 - 255*x^8 + 511*x^9 + ...
		

Crossrefs

Programs

  • Magma
    [(-1)^n*(1 - 2^n): n in [0..50]]; // G. C. Greubel, Aug 09 2018
  • Mathematica
    a[ n_] := If[ n<0, 0, (-1)^n (1 - 2^n)];
    LinearRecurrence[{-3,-2}, {0,1}, 50] (* G. C. Greubel, Aug 09 2018 *)
  • PARI
    {a(n) = if( n<0, 0, (-1)^n * (1 - 2^n))};
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( x / ((1 + x) * (1 + 2*x)) + x * O(x^n), n))};
    

Formula

G.f.: x / ((1 + x) * (1 + 2*x)) = 1 / (1+x) - 1 / (1 + 2*x).
E.g.f.: exp(-x) - exp(-2*x). a(n) = -2 * a(n-1) - (-1)^n if n>0.
a(n) = -(-1)^n * A000225(n). a(n) = -3 * a(n-1) - 2 * a(n-2) if n>1.
REVERT transform is A001003 omitting a(0)=0.
INVERT transform is A108520.
2^n = a(n+1)^2 - a(n) * a(n+2).
|a(n)| = A168604(n+2)= A000225(n).

A038521 Number of elements of GF(2^n) with trace 1 and subtrace 1.

Original entry on oeis.org

0, 0, 2, 1, 4, 10, 12, 36, 64, 120, 272, 496, 1024, 2080, 4032, 8256, 16384, 32640, 65792, 130816, 262144, 524800, 1047552, 2098176, 4194304, 8386560, 16781312, 33550336, 67108864, 134225920, 268419072, 536887296, 1073741824, 2147450880, 4295032832, 8589869056
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    I:=[0,0,2,1]; [m le 4 select I[m] else  2*Self(m-2) + 4*Self(m-3): m in [1..33]]; // Marius A. Burtea, Aug 02 2019
  • Maple
    A038521 := proc(n) local r,a,i ; if n mod 2 = 1 then r := 3 ; else r := 1 ; fi; a :=0 ; for i from r to n by 4 do a := a+binomial(n,i) ; od; a ; end: for n from 0 to 40 do printf("%d,",A038521(n)) ; od: # R. J. Mathar, Oct 20 2008
  • Mathematica
    LinearRecurrence[{0, 2, 4}, {0, 0, 2, 1}, 33] (* Jean-François Alcover, May 08 2023 *)
  • PARI
    concat([0, 0], Vec(x*(2 + x) / ((1 - 2*x)*(1 + 2*x + 2*x^2)) + O(x^35))) \\ Colin Barker, Aug 02 2019
    

Formula

a(n) = C(n, r+0) + C(n, r+4) + C(n, r+8) + ... where r = 3 if n odd, r = 1 if n even.
a(n) = (2^(n-1) - A108520(n-1))/2 if n > 0. - R. J. Mathar, Jan 29 2008
From Colin Barker, Aug 02 2019: (Start)
G.f.: x^2*(2 + x) / ((1 - 2*x)*(1 + 2*x + 2*x^2)).
a(n) = ((-1-i)^(n-2) + (-1+i)^(n-2) + 2^(n-1)) / 2 = 2*A176739(n-2) + A176739(n-3).
a(n) = 2*a(n-2) + 4*a(n-3) for n>3.
(End)

Extensions

Values duplicated A038520 and were replaced by R. J. Mathar, Oct 20 2008
Missing a(0) = 0 inserted by Andrey Zabolotskiy, Nov 12 2024

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

Original entry on oeis.org

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, -4194304, 0, 8388608
Offset: 0

Views

Author

Paul Barry, Nov 21 2003

Keywords

Comments

The expansion of (1-2x)/(1-2x+2x^2) has a(n) = Sum_{k=0..n} C(n,k)(-1)^(-k)(-1)^floor(k/2).
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

Examples

			G.f. = 1 - 2*x^2 + 4*x^3 - 4*x^4 + 8*x^6 - 16*x^7 + 16*x^8 - 32*x^10 + 64*x^11 + ...
		

Crossrefs

Programs

  • Mathematica
    a[ n_] := Re[ -(I - 1)^(n + 1)]; (* Michael Somos, May 25 2013 *)
    a[ n_] := If[ n < 0, - 2^(n-1) a[2 - n], SeriesCoefficient[ (1 + 2 x) / (1 + 2 x + 2 x^2), {x, 0, n}]]; (* Michael Somos, May 25 2013 *)
    a[ n_] := If[ n < 0, - 2^(n-1) a[2 - n], n! SeriesCoefficient[ (Cos[x] + Sin[x]) / Exp[x], {x, 0, n}]]; (* Michael Somos, May 25 2013 *)
    a[ n_] := Simplify[ -2 Sqrt[2]^(n - 1) ChebyshevT[ n + 1, -1 / Sqrt[2]]]; (* Michael Somos, May 25 2013 *)
    LinearRecurrence[{-2,-2},{1,0},50] (* Harvey P. Dale, Oct 23 2017 *)
  • PARI
    my(x='x+O('x^66)); Vec(serlaplace((cos(x)+sin(x))/exp(x))) \\ Joerg Arndt, May 13 2011
    
  • PARI
    vector(66, n, -real((-1+I)^n)) /* Joerg Arndt, May 13 2011 */
    
  • PARI
    {a(n) = real( -(I - 1)^(n + 1) )}; /* Michael Somos, May 25 2013 */
    
  • PARI
    {a(n) = if( n<0, - 2^(n-1) * a(2 - n), polcoeff( (1 + 2*x) / (1 + 2*x + 2*x^2) + x * O(x^n), n))}; /* Michael Somos, May 25 2013 */
    
  • PARI
    {a(n) = my(A); if( n<0, - 2^(n-1) * a(2 - n), A = x * O(x^n); n! * polcoeff( (cos(x + A) + sin(x + A)) / exp(x + A), n))}; /* Michael Somos, May 25 2013 */
    
  • PARI
    {a(n) = simplify( -2 * quadgen(8)^(n - 1) * polchebyshev( n + 1, 1, -1 / quadgen(8)))}; /* Michael Somos, May 25 2013 */

Formula

G.f.: (1+2*x)/(1+2*x+2*x^2).
a(n) = Sum_{k=0..n} C(n, k)*(-1)^(n-k)*(-1)^floor(k/2).
a(n) = sqrt(2)*2^(n/2)*sin(3*Pi*n/4+Pi/4). - Paul Barry, Feb 25 2004
a(n) = -a(n-1) + 2*a(n-3). - Paul Curtz, Apr 24 2008
Negated real part of (-1+i)^n, imaginary part is A108520. - Joerg Arndt, May 13 2011
From Sergei N. Gladkovskii, Nov 28 2011: (Start)
E.g.f.: (cos(x) + sin(x))/exp(x).
E.g.f.: A(x) = Q(0), where Q(k)=1-(x^2)/((4*k+1)*(2*k+1)+2*x*(4*k+1)*(2*k+1)/(4*k+3-2*x-x*(4*k+3)/(x-(4*k+4)/Q(k+1)))); (continued fraction). (End)
a(4*n + 1) = 0. a(2*n) = A120617(n). a(4*n + 3) = (-4)^n. - Michael Somos, May 25 2013
a(n) = - 2^(n-1)*a(2-n) for all n in Z. - Michael Somos, Jun 26 2017
a(n) = (I + 1)*((-1 - I)^n - I*(-1 + I)^n)/2. - Taras Goy, Apr 20 2019

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

Original entry on oeis.org

1, -3, 4, -2, -4, 12, -16, 8, 16, -48, 64, -32, -64, 192, -256, 128, 256, -768, 1024, -512, -1024, 3072, -4096, 2048, 4096, -12288, 16384, -8192, -16384, 49152, -65536, 32768, 65536, -196608, 262144, -131072, -262144, 786432, -1048576, 524288, 1048576, -3145728, 4194304, -2097152, -4194304
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Comments

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

Cf. A090131.

Programs

  • Mathematica
    CoefficientList[Series[(1-x)/(1+2x+2x^2),{x,0,50}],x] (* or *) LinearRecurrence[{-2,-2},{1,-3},50] (* Harvey P. Dale, Jan 19 2012 *)
  • PARI
    Vec((1-x)/(1+2*x+2*x^2)+O(x^99)) \\ Charles R Greathouse IV, Sep 25 2012

Formula

a(n) = (-2)*(a(n-1)+a(n-2)), n>1 ; a(0)=1, a(1)=-3. - Philippe Deléham, Nov 19 2008
a(n) = A108520(n)-A108520(n-1). - R. J. Mathar, Aug 11 2012
G.f.: G(0)*(1 - 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, Jun 20 2013
a(n) = (1/2 - I)*(-1 - I)^n + (1/2 + I)*(-1 + I)^n, n>=0. Taras Goy, Apr 20 2019

A318439 For any n >= 0 with binary expansion Sum_{k=0..w} b_k * 2^k, let h(n) = Sum_{k=0..w} b_k * (i-1)^k (where i denotes the imaginary unit); a(n) is the imaginary part of h(n).

Original entry on oeis.org

0, 0, 1, 1, -2, -2, -1, -1, 2, 2, 3, 3, 0, 0, 1, 1, 0, 0, 1, 1, -2, -2, -1, -1, 2, 2, 3, 3, 0, 0, 1, 1, -4, -4, -3, -3, -6, -6, -5, -5, -2, -2, -1, -1, -4, -4, -3, -3, -4, -4, -3, -3, -6, -6, -5, -5, -2, -2, -1, -1, -4, -4, -3, -3, 8, 8, 9, 9, 6, 6, 7, 7, 10
Offset: 0

Views

Author

Rémy Sigrist, Aug 26 2018

Keywords

Comments

See A318438 for the real part of h and additional comments.

Crossrefs

Programs

  • PARI
    a(n) = my (d=Vecrev(digits(n,2))); imag(sum(i=1, #d, d[i]*(I-1)^(i-1)))

Formula

a(2^k) = A108520(k-1) for any k > 0.

A306913 Square array A(n,k), n >= 0, k >= 1, read by antidiagonals, where column k is the expansion of g.f. 1/((1+x)^k+x^k).

Original entry on oeis.org

1, 1, -2, 1, -2, 4, 1, -3, 2, -8, 1, -4, 6, 0, 16, 1, -5, 10, -11, -4, -32, 1, -6, 15, -20, 21, 8, 64, 1, -7, 21, -35, 34, -42, -8, -128, 1, -8, 28, -56, 70, -48, 85, 0, 256, 1, -9, 36, -84, 126, -127, 48, -171, 16, -512, 1, -10, 45, -120, 210, -252, 220, 0, 342, -32, 1024
Offset: 0

Views

Author

Seiichi Manyama, Mar 16 2019

Keywords

Examples

			Square array begins:
      1,  1,    1,    1,    1,    1,     1,     1, ...
     -2, -2,   -3,   -4,   -5,   -6,    -7,    -8, ...
      4,  2,    6,   10,   15,   21,    28,    36, ...
     -8,  0,  -11,  -20,  -35,  -56,   -84,  -120, ...
     16, -4,   21,   34,   70,  126,   210,   330, ...
    -32,  8,  -42,  -48, -127, -252,  -462,  -792, ...
     64, -8,   85,   48,  220,  461,   924,  1716, ...
   -128,  0, -171,    0, -385, -780, -1717, -3432, ...
    256, 16,  342, -164,  715, 1209,  3017,  6434, ...
		

Crossrefs

Columns 1-2 give A122803, A108520.

Programs

  • Mathematica
    A[n_, k_] := (-1)^n * Sum[(-1)^(Mod[k+1, 2] * j) * Binomial[n + k - 1, k*j + k - 1], {j, 0, Floor[n/k]}]; Table[A[n - k, k], {n, 0, 11}, {k, n, 1, -1}] // Flatten (* Amiram Eldar, May 25 2021 *)

Formula

A(n,k) = (-1)^n * Sum_{j=0..floor(n/k)} (-1)^(((k+1) mod 2) * j) * binomial(n+k-1,k*j+k-1).
Showing 1-10 of 20 results. Next