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.

Previous Showing 11-20 of 53 results. Next

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

A098593 A triangle of Krawtchouk coefficients.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, -1, -1, 1, 1, -2, -2, -2, 1, 1, -3, -2, -2, -3, 1, 1, -4, -1, 0, -1, -4, 1, 1, -5, 1, 3, 3, 1, -5, 1, 1, -6, 4, 6, 6, 6, 4, -6, 1, 1, -7, 8, 8, 6, 6, 8, 8, -7, 1, 1, -8, 13, 8, 2, 0, 2, 8, 13, -8, 1, 1, -9, 19, 5, -6, -10, -10, -6, 5, 19, -9, 1, 1, -10, 26, -2, -17, -20, -20, -20, -17, -2, 26, -10, 1, 1, -11, 34, -14, -29, -25
Offset: 0

Views

Author

Paul Barry, Sep 17 2004

Keywords

Comments

Row sums are A009545(n+1), with e.g.f. exp(x)(cos(x)+sin(x)). Diagonal sums are A077948.
The rows are the diagonals of the Krawtchouk matrices. Coincides with the Riordan array (1/(1-x),(1-2x)/(1-x)). - Paul Barry, Sep 24 2004
Corresponds to Pascal-(1,-2,1) array, read by antidiagonals. The Pascal-(1,-2,1) array has n-th row generated by (1-2x)^n/(1-x)^(n+1). - Paul Barry, Sep 24 2004
A modified version (different signs) of this triangle is given by T(n,k) = Sum_{j=0..n} C(n-k,j)*C(k,j)*cos(Pi*(k-j)). - Paul Barry, Jun 14 2007

Examples

			Rows begin {1}, {1,1}, {1,0,1}, {1,-1,-1,1}, {1,-2,-2,-2,1}, ...
From _Paul Barry_, Oct 05 2010: (Start)
Triangle begins
  1,
  1,  1,
  1,  0,  1,
  1, -1, -1,  1,
  1, -2, -2, -2,  1,
  1, -3, -2, -2, -3,  1,
  1, -4, -1,  0, -1, -4,  1,
  1, -5,  1,  3,  3,  1, -5,  1,
  1, -6,  4,  6,  6,  6,  4, -6,  1,
  1, -7,  8,  8,  6,  6,  8,  8, -7,  1,
  1, -8, 13,  8,  2,  0,  2,  8, 13, -8,  1
Production matrix (related to large Schroeder numbers A006318) begins
  1,     1,
  0,    -1,     1,
  0,    -2,    -1,    1,
  0,    -6,    -2,   -1,   1,
  0,   -22,    -6,   -2,  -1,   1,
  0,   -90,   -22,   -6,  -2,  -1,  1,
  0,  -394,   -90,  -22,  -6,  -2, -1,  1,
  0, -1806,  -394,  -90, -22,  -6, -2, -1,  1,
  0, -8558, -1806, -394, -90, -22, -6, -2, -1, 1
Production matrix of inverse is
    -1,   1,
    -2,   1,  1,
    -4,   2,  1,  1,
    -8,   4,  2,  1,  1,
   -16,   8,  4,  2,  1, 1,
   -32,  16,  8,  4,  2, 1, 1,
   -64,  32, 16,  8,  4, 2, 1, 1,
  -128,  64, 32, 16,  8, 4, 2, 1, 1,
  -256, 128, 64, 32, 16, 8, 4, 2, 1, 1 (End)
		

References

  • P. Feinsilver and J. Kocik, Krawtchouk matrices from classical and quantum walks, Contemporary Mathematics, 287 2001, pp. 83-96.

Crossrefs

Cf. Pascal (1,m,1) array: A123562 (m = -3), A000012 (m = -1), A007318 (m = 0), A008288 (m = 1), A081577 (m = 2), A081578 (m = 3), A081579 (m = 4), A081580 (m = 5), A081581 (m = 6), A081582 (m = 7), A143683 (m = 8).

Programs

  • Mathematica
    T[n_, k_] := Sum[Binomial[n - k, k - j]*Binomial[k, j]*(-1)^(k - j), {j, 0, n}]; Table[T[n, k], {n, 0, 49}, {k, 0, n}] // Flatten (* G. C. Greubel, Oct 15 2017 *)
  • PARI
    for(n=0,10, for(k=0,n, print1(sum(i=0,k, binomial(n-k, k-i) *binomial(k, i)*(-1)^(k-i)), ", "))) \\ G. C. Greubel, Oct 15 2017

Formula

T(n, k) = Sum_{i=0..k} binomial(n-k, k-i)*binomial(k, i)*(-1)^(k-i), k<=n.
T(n, k) = T(n-1, k) + T(n-1, k-1) - 2*T(n-2, k-1) (n>0). - Paul Barry, Sep 24 2004
T(n, k) = [k<=n]*Hypergeometric2F1(-k,k-n;1;-1). - Paul Barry, Jan 24 2011
E.g.f. for the n-th subdiagonal: exp(x)*P(n,x), where P(n,x) is the polynomial Sum_{k = 0..n} (-1)^k*binomial(n,k)* x^k/k!. For example, the e.g.f. for the second subdiagonal is exp(x)*(1 - 2*x + x^2/2) = 1 - x - 2*x^2/2! - 2*x^3/3! - x^4/4! + x^5/5! + .... - Peter Bala, Mar 05 2017

A057681 a(n) = Sum_{j=0..floor(n/3)} (-1)^j*binomial(n,3*j).

Original entry on oeis.org

1, 1, 1, 0, -3, -9, -18, -27, -27, 0, 81, 243, 486, 729, 729, 0, -2187, -6561, -13122, -19683, -19683, 0, 59049, 177147, 354294, 531441, 531441, 0, -1594323, -4782969, -9565938, -14348907, -14348907, 0, 43046721, 129140163, 258280326, 387420489, 387420489
Offset: 0

Views

Author

N. J. A. Sloane, Oct 20 2000

Keywords

Comments

Let M be any endomorphism on any vector space, such that M^3 = 1 (identity). Then (1-M)^n = a(n)-A057682(n)*M+z(n)*M^2, where z(0)=z(1)=0 and, apparently, z(n+2)=A057083(n). - Stanislav Sykora, Jun 10 2012
Pisano period lengths: 1, 3, 1, 6, 24, 3, 6, 12, 1, 24, 60, 6, 12, 6, 24, 24, 96, 3, 18, 24, ... . - R. J. Mathar, Aug 10 2012
{A057681, A057682, A*}, where A* is A057083 prefixed by two 0's, is the difference analog of the trigonometric functions of order 3, {k_1(x), k_2(x), k_3(x)}. For a definition see [Erdelyi] and the Shevelev link. - Vladimir Shevelev, Jun 25 2017

Examples

			If M^3=1 then (1-M)^6 = a(6)-A057682(6)*M+A057083(4)*M^2 = -18+9*M+9*M^2.
		

References

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

Crossrefs

Programs

  • GAP
    a:=[1,1];; for n in [3..40] do a[n]:=3*a[n-1]-3*a[n-2]; od; Concatenation([1],a); # Muniru A Asiru, Oct 24 2018
  • Magma
    I:=[1,1]; [1] cat [n le 2 select I[n] else 3*Self(n-1) - 3*Self(n-2): n in [1..40]]; // G. C. Greubel, Oct 23 2018
    
  • Maple
    A057681 := n->add((-1)^j*binomial(n,3*j),j=0..floor(n/3)); seq(A057681(n), n=0..50);
    A057681_list := proc(n) local i; series((1+2*exp(3*z/2)*cos(z*sqrt(3/4)))/3, z,n+2): seq(i!*coeff(%,z,i),i=0..n) end: A057681_list(38); # Peter Luschny, Jul 10 2012
  • Mathematica
    Join[{1},LinearRecurrence[{3,-3},{1,1},40]] (* Harvey P. Dale, Aug 19 2014 *)
  • PARI
    x='x+O('x^40); Vec((1-x)^2/((1-x)^3+x^3)) \\ G. C. Greubel, Oct 23 2018
    

Formula

From Paul Barry, Feb 26 2004: (Start)
G.f.: (1-x)^2/((1-x)^3+x^3).
a(n) = 0^n/3 + 2*3^((n-2)/2)*cos(Pi*n/6). (End)
From Paul Barry, Feb 27 2004: (Start)
Binomial transform of (1, 0, 0, -1, 0, 0, 1, 0, 0, -1, 0, ...).
E.g.f.: 2*exp(3x/2)*cos(sqrt(3)*x/2)/3+1/3.
a(n) = (((3+sqrt(-3))/2)^n+((3-sqrt(-3))/2)^n)/3+0^n/3. (End)
a(n) = 6*a(n-1)-15*a(n-2)+20*a(n-3)-15*a(n-4)+6*a(n-5). - Paul Curtz, Jan 02 2008
Start with x(0)=1,y(0)=0,z(0)=0 and set x(n+1)=x(n)-z(n), y(n+1)=y(n)-x(n),z(n+1)=z(n)-y(n). Then a(n)=x(n). But this recurrence falls into a repetitive cycle of length 6 and multiplicative factor -27, so that a(n) = -27*a(n-6) for any n>6. - Stanislav Sykora, Jun 10 2012
E.g.f.: (1+2*exp(3*z/2)*cos(z*sqrt(3/4)))/3. - Peter Luschny, Jul 10 2012
a(0)=a(1)=a(2)=1, a(n)=3*a(n-1)-3*a(n-2), n>=3. - Wesley Ivan Hurt, Nov 11 2014
For n>=1, a(n) = 2*3^((n-2)/2)*cos(Pi*n/6). - Vladimir Shevelev, Jun 25 2017
a(n+m) = a(n)*a(m)-A057682(n)*A*057083(m)-A*057083(n)*A057682(m), where A*057083 is A057083 prefixed by two 0's. - Vladimir Shevelev, Jun 25 2017

A135356 Triangle T(n,k) read by rows: coefficients in the recurrence of sequences which equal their n-th differences.

Original entry on oeis.org

2, 2, 0, 3, -3, 2, 4, -6, 4, 0, 5, -10, 10, -5, 2, 6, -15, 20, -15, 6, 0, 7, -21, 35, -35, 21, -7, 2, 8, -28, 56, -70, 56, -28, 8, 0, 9, -36, 84, -126, 126, -84, 36, -9, 2, 10, -45, 120, -210, 252, -210, 120, -45, 10, 0, 11, -55, 165, -330, 462, -462, 330, -165, 55, -11, 2
Offset: 1

Views

Author

Paul Curtz, Dec 08 2007, Mar 25 2008, Apr 28 2008

Keywords

Comments

Sequences which equal their p-th differences obey recurrences a(n) = Sum_{s=1..p} T(p,s)*a(n-s).
This defines T(p,s) as essentially a signed version of a chopped Pascal triangle A014410, see A130785.
For cases like p=2, 4, 6, 8, 10, 12, 14, the denominator of the rational generating function of a(n) contains a factor 1-x; depending on the first terms in the sequences a(n), additional, simpler recurrences may exist if this cancels with a factor in the numerator. - R. J. Mathar, Jun 10 2008

Examples

			Triangle begins with row n=1:
  2;
  2,   0;
  3,  -3,  2;
  4,  -6,  4,    0;
  5, -10, 10,   -5,   2;
  6, -15, 20,  -15,   6,   0;
  7, -21, 35,  -35,  21,  -7,  2;
  8, -28, 56,  -70,  56, -28,  8,  0;
  9, -36, 84, -126, 126, -84, 36, -9, 2;
		

Crossrefs

Related sequences: A000079 (n=1), A131577 (n=2), (A131708 , A130785, A131562, A057079) (n=3), (A000749, A038503, A009545, A038505) (n=4), A133476 (n=5), A140343 (n=6), A140342 (n=7).

Programs

  • Magma
    A135356:= func< n,k | k eq n select 1-(-1)^n else (-1)^(k+1)*Binomial(n,k) >;
    [A135356(n,k): k in [1..n], n in [1..12]]; // G. C. Greubel, Apr 09 2023
    
  • Maple
    T:= (p, s)->  `if`(p=s, 2*irem(p, 2), (-1)^(s+1) *binomial(p, s)):
    seq(seq(T(p, s), s=1..p), p=1..11);  # Alois P. Heinz, Aug 26 2011
  • Mathematica
    T[p_, s_]:= If[p==s, 2*Mod[s, 2], (-1)^(s+1)*Binomial[p, s]];
    Table[T[p, s], {p, 12}, {s, p}]//Flatten (* Jean-François Alcover, Feb 19 2015, after Alois P. Heinz *)
  • SageMath
    def A135356(n,k):
        if (k==n): return 2*(n%2)
        else: return (-1)^(k+1)*binomial(n,k)
    flatten([[A135356(n,k) for k in range(1,n+1)] for n in range(1,13)]) # G. C. Greubel, Apr 09 2023

Formula

T(n,k) = (-1)^(k+1)*A007318(n, k). T(n,n) = 1 - (-1)^n.
Sum_{k=1..n} T(n, k) = 2.
From G. C. Greubel, Apr 09 2023: (Start)
Sum_{k=1..n} (-1)^(k-1)*T(n, k) = 2*A051049(n-1).
Sum_{k=1..n-1} T(n, k) = (1 + (-1)^n).
Sum_{k=1..n-1} (-1)^(k-1)*T(n, k) = A000225(n-1).
T(2*n, n) = (-1)^(n-1)*A000984(n), n >= 1. (End)

Extensions

Edited by R. J. Mathar, Jun 10 2008

A057086 Scaled Chebyshev U-polynomials evaluated at sqrt(10)/2.

Original entry on oeis.org

1, 10, 90, 800, 7100, 63000, 559000, 4960000, 44010000, 390500000, 3464900000, 30744000000, 272791000000, 2420470000000, 21476790000000, 190563200000000, 1690864100000000, 15003009000000000, 133121449000000000, 1181184400000000000, 10480629510000000000
Offset: 0

Views

Author

Wolfdieter Lang, Aug 11 2000

Keywords

Comments

This is the m=10 member of the m-family of sequences S(n,sqrt(m))*(sqrt(m))^n; for S(n,x) see Formula. The m=4..9 instances are A001787, A030191, A030192, A030240, A057084-5 and the m=1..3 signed sequences are A010892, A009545, A057083.
The characteristic roots are rp(m) := (m + sqrt(m*(m-4)))/2 and rm(m) := (m-sqrt(m*(m-4)))/2 and a(n,m)= (rp(m)^(n+1) - rm(m)^(n+1))/(rp(m) - rm(m)) is the Binet form of these m-sequences.

Crossrefs

Programs

  • Magma
    [(10)^n*Evaluate(DicksonSecond(n, 1/10), 1): n in [0..30]]; // G. C. Greubel, May 02 2022
  • Mathematica
    Join[{a=1,b=10},Table[c=10*b-10*a;a=b;b=c,{n,60}]] (* Vladimir Joseph Stephan Orlovsky, Jan 20 2011 *)
  • PARI
    Vec(1/(1-10*x+10*x^2) + O(x^30)) \\ Colin Barker, Jun 14 2015
    
  • Sage
    [lucas_number1(n,10,10) for n in range(1, 20)] # Zerinvary Lajos, Apr 26 2009
    

Formula

a(n) = 10*(a(n-1) - a(n-2)), a(-1)=0, a(0)=1.
a(n) = S(n, sqrt(10))*(sqrt(10))^n with S(n, x) := U(n, x/2), Chebyshev's polynomials of the 2nd kind, A049310.
a(2*k) = A057080(k)*10^k, a(2*k+1) = A001090(k)*10^(k+1).
G.f.: 1/(1-10*x+10*x^2).
a(n) = Sum_{k=0..n} A109466(n,k)*10^k. - Philippe Deléham, Oct 28 2008

A084102 Inverse binomial transform of A084101.

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

Views

Author

Paul Barry, May 15 2003

Keywords

Comments

The sequence {2, -2, 0, 4, -8, 8, 0, -16, 32, -32, 0, 64, -128, 128, 0, ...} (without the leading 1) is the Lucas V(-2, 2) sequence. - R. J. Mathar, Jan 08 2013

Crossrefs

Yet another variation on A009545.

Programs

  • Magma
    [1] cat [n le 2 select 2*(-1)^(n-1) else -2*(Self(n-1) +Self(n-2)): n in [1..40]]; // G. C. Greubel, Oct 13 2022
    
  • Mathematica
    LinearRecurrence[{-2,-2},{1,2,-2},50] (* Harvey P. Dale, Aug 09 2017 *)
  • SageMath
    b=BinaryRecurrenceSequence(-2,-2,2,-2)
    def A084102(n): return 1 if (n==0) else b(n-1)
    [A084102(n) for n in range(41)] # G. C. Greubel, Oct 13 2022

Formula

G.f.: (1+2*x)^2/(1+2*x+2*x^2). - Paul D. Hanna, Nov 05 2009
From G. C. Greubel, Oct 13 2022: (Start)
a(n) = 2*A009116(n-1), n >= 1, with a(0) = 1.
a(n) = Real part of ( 2*(-1-i)^(n-1) + 2*[n=0] ).
a(n) = 2*(-1)^n*(2*(1+i)^(n-5) + i*(1-i)^(n-3)), n >= 1, with a(0) = 1.
E.g.f.: 2 - exp(-x)*(cos(x) - sin(x)). (End)

A115415 Real part of (n + i)^n, with i=sqrt(-1).

Original entry on oeis.org

1, 1, 3, 18, 161, 1900, 27755, 482552, 9722113, 222612624, 5707904499, 161981127968, 5039646554593, 170561613679808, 6237995487261915, 245159013138710400, 10303367499652761601, 461102348510408544512, 21891769059478538933603, 1098983344602124698522112
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 22 2006

Keywords

Crossrefs

Cf. A000312, A009545, A115416 (imaginary part), A121626, A370189.

Programs

  • Mathematica
    Table[ Re[(n + I)^n], {n, 0, 17}] (* Robert G. Wilson v, Jan 23 2006 *)
  • PARI
    a(n) = real((n + I)^n); \\ Michel Marcus, Apr 11 2018
    
  • Python
    from math import comb
    def A115415(n): return sum(comb(n,j)*n**(n-j)*(-1 if j&2 else 1) for j in range(0,n+1,2)) # Chai Wah Wu, Feb 15 2024

Formula

a(n) = n! * [x^n] exp(n*x)*cos(x). - Ilya Gutkovskiy, Apr 10 2018
a(n) ~ cos(1) * n^n. - Vaclav Kotesovec, Jun 08 2019
a(n) = Sum_{j=0..floor(n/2)} binomial(n,2j)*n^(n-2j)*(-1)^j. - Chai Wah Wu, Feb 15 2024
a(n) = (1/2)*((n + i)^n + (n - i)^n) where i is the imaginary unit. - Gerry Martens, Dec 30 2024

Extensions

More terms from Robert G. Wilson v, Jan 23 2006
Previous Showing 11-20 of 53 results. Next