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 21-30 of 36 results. Next

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

Original entry on oeis.org

1, 3, 5, 5, 1, -7, -15, -15, 1, 33, 65, 65, 1, -127, -255, -255, 1, 513, 1025, 1025, 1, -2047, -4095, -4095, 1, 8193, 16385, 16385, 1, -32767, -65535, -65535, 1, 131073, 262145, 262145, 1, -524287, -1048575, -1048575, 1, 2097153, 4194305, 4194305, 1, -8388607, -16777215, -16777215
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Programs

  • Magma
    I:=[1,3,5]; [n le 3 select I[n] else 3*Self(n-1)-4*Self(n-2)+2*Self(n-3): n in [1..60]]; // Vincenzo Librandi, Jul 02 2015
  • Mathematica
    Join[{a=1,b=3},Table[c=2*b-2*a+1;a=b;b=c,{n,100}]] (* Vladimir Joseph Stephan Orlovsky, Jan 17 2011 *)
    CoefficientList[Series[1/((1-2x+2x^2)(1-x)),{x,0,60}],x] (* or *) LinearRecurrence[{3,-4,2},{1,3,5},60] (* Harvey P. Dale, Feb 01 2013 *)
  • Maxima
    a(n):=sum((-1)^k*2^(n-k)*binomial(n-k-1,k),k,0,n); /* Vladimir Kruchinin, Jul 02 2015 */
    
  • PARI
    Vec(1/((1-2*x+2*x^2)*(1-x))+O(x^99)) \\ Charles R Greathouse IV, Sep 26 2012
    
  • PARI
    a(n) = 1 + 2*imag((1 + I)^n); \\ Daniel Suteu, Dec 21 2018
    

Formula

a(n) = 1-A146559(n+2). a(n)= 3*a(n-1) -4*a(n-2) +2*a(n-3). - R. J. Mathar, Jan 18 2011
G.f.: Q(0) where Q(k) = 1 + k*(2*x+1) + 8*x - 2*x*(k+1)*(k+5)/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Mar 14 2013
G.f.: G(0)/(2*(1-x)^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(n) = Sum_{k=0..n} ((-1)^k*2^(n-k)*binomial(n-k-1,k)). - Vladimir Kruchinin, Jul 02 2015
a(n) = 1 + 2^(1 + n/2)*sin((n*Pi)/4). - Jean-François Alcover, Jul 02 2015
a(n) = 1 + 2*Im((1 + i)^n), where i is the imaginary unit. - Daniel Suteu, Dec 21 2018
a(n) = Sum_{k=0..floor(n/2)} (-1)^k*binomial(n+2,2*k+2). - Taras Goy, Jan 03 2025
E.g.f.: exp(x)*(1 + 2*sin(x)). - Stefano Spezia, Jan 03 2025

A121625 Real part of (n + n*i)^n.

Original entry on oeis.org

1, 1, 0, -54, -1024, -12500, 0, 6588344, 268435456, 6198727824, 0, -9129973459552, -570630428688384, -19384006821904192, 0, 56050417968750000000, 4722366482869645213696, 211773507042902211629312, 0, -1012950863698080557631477248, -107374182400000000000000000000
Offset: 0

Views

Author

Gary W. Adamson, Aug 12 2006

Keywords

Examples

			a(7) = 6588344 since (7 + 7i)^7 = (6588344 - 6588344i).
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Re[(n + n*I)^n]; Array[a, 19] (* Robert G. Wilson v, Aug 17 2006 *)
  • PARI
    a(n) = real((n + n*I)^n); \\ Michel Marcus, Dec 19 2020
    
  • Python
    def A121625(n): return n**n*((1, 1, 0, -2)[n&3]<<((n>>1)&-2))*(-1 if n&4 else 1) # Chai Wah Wu, Feb 16 2024

Formula

a(n) = Re(n + n*i)^n.
From Chai Wah Wu, Feb 15 2024: (Start)
a(n) = n^n*Re((1+i)^n) = n^n*A146559(n) = n^n*Sum_{n=0..floor(n/2)} binomial(n,2j)*(-1)^j.
a(n) = 0 if and only if n==2 mod 4, as (1+i)^2=2i is purely imaginary, (1+i)^4=-4 is a nonzero real and (1+i) and (1+i)^3=-2+2i both have nonzero real parts.
(End)

Extensions

More terms from Robert G. Wilson v, Aug 17 2006
a(0)=1 prepended by Alois P. Heinz, Dec 19 2020

A172455 The case S(6,-4,-1) of the family of self-convolutive recurrences studied by Martin and Kearney.

Original entry on oeis.org

1, 7, 84, 1463, 33936, 990542, 34938624, 1445713003, 68639375616, 3676366634402, 219208706540544, 14397191399702118, 1032543050697424896, 80280469685284582812, 6725557192852592984064, 603931579625379293509683
Offset: 1

Views

Author

N. J. A. Sloane, Nov 20 2010

Keywords

Examples

			G.f. = x + 7*x^2 + 84*x^3 + 1463*x^4 + 33936*x^5 + 990542*x^6 + 34938624*x^7 + ...
a(2) = 7 since (6*2 - 4) * a(2-1) - (a(1) * a(2-1)) = 7.
		

Crossrefs

Cf. A000079 S(1,1,-1), A000108 S(0,0,1), A000142 S(1,-1,0), A000244 S(2,1,-2), A000351 S(4,1,-4), A000400 S(5,1,-5), A000420 S(6,1,-6), A000698 S(2,-3,1), A001710 S(1,1,0), A001715 S(1,2,0), A001720 S(1,3,0), A001725 S(1,4,0), A001730 S(1,5,0), A003319 S(1,-2,1), A005411 S(2,-4,1), A005412 S(2,-2,1), A006012 S(-1,2,2), A006318 S(0,1,1), A047891 S(0,2,1), A049388 S(1,6,0), A051604 S(3,1,0), A051605 S(3,2,0), A051606 S(3,3,0), A051607 S(3,4,0), A051608 S(3,5,0), A051609 S(3,6,0), A051617 S(4,1,0), A051618 S(4,2,0), A051619 S(4,3,0), A051620 S(4,4,0), A051621 S(4,5,0), A051622 S(4,6,0), A051687 S(5,1,0), A051688 S(5,2,0), A051689 S(5,3,0), A051690 S(5,4,0), A051691 S(5,5,0), A053100 S(6,1,0), A053101 S(6,2,0), A053102 S(6,3,0), A053103 S(6,4,0), A053104 S(7,1,0), A053105 S(7,2,0), A053106 S(7,3,0), A062980 S(6,-8,1), A082298 S(0,3,1), A082301 S(0,4,1), A082302 S(0,5,1), A082305 S(0,6,1), A082366 S(0,7,1), A082367 S(0,8,1), A105523 S(0,-2,1), A107716 S(3,-4,1), A111529 S(1,-3,2), A111530 S(1,-4,3), A111531 S(1,-5,4), A111532 S(1,-6,5), A111533 S(1,-7,6), A111546 S(1,0,1), A111556 S(1,1,1), A143749 S(0,10,1), A146559 S(1,1,-2), A167872 S(2,-3,2), A172450 S(2,0,-1), A172485 S(-1,-2,3), A177354 S(1,2,1), A292186 S(4,-6,1), A292187 S(3, -5, 1).

Programs

  • Mathematica
    a[1] = 1; a[n_]:= a[n] = (6*n-4)*a[n-1] - Sum[a[k]*a[n-k], {k, 1, n-1}]; Table[a[n], {n, 1, 20}] (* Vaclav Kotesovec, Jan 19 2015 *)
  • PARI
    {a(n) = local(A); if( n<1, 0, A = vector(n); A[1] = 1; for( k=2, n, A[k] = (6 * k - 4) * A[k-1] - sum( j=1, k-1, A[j] * A[k-j])); A[n])} /* Michael Somos, Jul 24 2011 */
    
  • PARI
    S(v1, v2, v3, N=16) = {
      my(a = vector(N)); a[1] = 1;
      for (n = 2, N, a[n] = (v1*n+v2)*a[n-1] + v3*sum(j=1,n-1,a[j]*a[n-j])); a;
    };
    S(6,-4,-1)
    \\ test: y = x*Ser(S(6,-4,-1,201)); 6*x^2*y' == y^2 - (2*x-1)*y - x
    \\ Gheorghe Coserea, May 12 2017

Formula

a(n) = (6*n - 4) * a(n-1) - Sum_{k=1..n-1} a(k) * a(n-k) if n>1. - Michael Somos, Jul 24 2011
G.f.: x / (1 - 7*x / (1 - 5*x / (1 - 13*x / (1 - 11*x / (1 - 19*x / (1 - 17*x / ... )))))). - Michael Somos, Jan 03 2013
a(n) = 3/(2*Pi^2)*int((4*x)^((3*n-1)/2)/(Ai'(x)^2+Bi'(x)^2), x=0..inf), where Ai'(x), Bi'(x) are the derivatives of the Airy functions. [Vladimir Reshetnikov, Sep 24 2013]
a(n) ~ 6^n * (n-1)! / (2*Pi) [Martin + Kearney, 2011, p.16]. - Vaclav Kotesovec, Jan 19 2015
6*x^2*y' = y^2 - (2*x-1)*y - x, where y(x) = Sum_{n>=1} a(n)*x^n. - Gheorghe Coserea, May 12 2017
G.f.: x/(1 - 2*x - 5*x/(1 - 7*x/(1 - 11*x/(1 - 13*x/(1 - ... - (6*n - 1)*x/(1 - (6*n + 1)*x/(1 - .... Cf. A062980. - Peter Bala, May 21 2017

A193410 Expansion of (1-3*x)/(1-6*x+18*x^2).

Original entry on oeis.org

1, 3, 0, -54, -324, -972, 0, 17496, 104976, 314928, 0, -5668704, -34012224, -102036672, 0, 1836660096, 11019960576, 33059881728, 0, -595077871104, -3570467226624, -10711401679872, 0, 192805230237696, 1156831381426176, 3470494144278528
Offset: 0

Views

Author

Bruno Berselli, Aug 04 2011

Keywords

Comments

Also real parts of 3^n*(1+i)^n, where i=sqrt(-1).
If |a(n)| > 0 then it is in A130505.

Crossrefs

Programs

  • Magma
    m:=26; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1-3*x)/(1-6*x+18*x^2))); /* or */ &cat[[r,3*r,0,-54*r] where r is (-324)^n: n in [0..6]];
    
  • Magma
    I:=[1, 3]; [n le 2 select I[n] else 6*Self(n-1)-18*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Mar 26 2013
  • Mathematica
    CoefficientList[Series[(1 - 3 x)/(1 - 6 x + 18 x^2), {x, 0, 30}], x] (* Vincenzo Librandi, Mar 26 2013 *)
    LinearRecurrence[{6,-18},{1,3},40] (* Harvey P. Dale, Jul 27 2021 *)
  • Maxima
    makelist(coeff(taylor((1-3*x)/(1-6*x+18*x^2), x, 0, n), x, n), n, 0, 25);
    
  • PARI
    Vec((1-3*x)/(1-6*x+18*x^2) +O(x^26))
    

Formula

G.f.: (1-3*x)/(1-6*x+18*x^2).
a(n) = 3^n*A146559(n) = (1/2)*((3+3*i)^n+(3-3*i)^n), where i=sqrt(-1).
a(n) = 6*a(n-1)-18*a(n-2) for n>1.
a(n) = (3*sqrt(2))^n*cos(pi*n/4).
a(4k+2) = 0, a(4k+1) = 3*a(4k) = 18*a(4k-1) = 3*(-324)^k.
G.f.: W(0)/2, where W(k) = 1 + 1/(1 - x*(3*k+3)/(x*(3*k+6) + 1/W(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 28 2013

A348690 For any nonnegative number n with binary expansion Sum_{k >= 0} b_k * 2^k, a(n) is the real part of f(n) = Sum_{k >= 0} b_k * (i^Sum_{j = 0..k-1} b_j) * (1+i)^k (where i denotes the imaginary unit); sequence A348691 gives the imaginary part.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Oct 29 2021

Keywords

Comments

The function f defines a bijection from the nonnegative integers to the Gaussian integers.
The function f has similarities with A065620; here the nonzero digits in base 1+i cycle through powers of i, there nonzero digits in base 2 cycle through powers of -1.
If we replace 1's in binary expansions by powers of i from left to right (rather than right to left as here), then we obtain the Lévy C curve (A332251, A332252).

Crossrefs

See A332251 for a similar sequence.

Programs

  • PARI
    a(n) = { my (v=0, o=0, x); while (n, n-=2^x=valuation(n, 2); v+=I^o * (1+I)^x; o++); real(v) }

Formula

a(2^k) = A146559(k) for any k >= 0.

A200545 Triangle T(n,k), read by rows, given by (1,0,2,1,3,2,4,3,5,4,6,5,7,6,8,7,9,8,...) DELTA (0,1,0,1,0,1,0,1,0,1,0,1,0,1,...) where DELTA is the operator defined in A084938.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 4, 1, 0, 1, 13, 9, 1, 0, 1, 46, 56, 16, 1, 0, 1, 199, 334, 160, 25, 1, 0, 1, 1072, 2157, 1408, 365, 36, 1, 0, 1, 6985, 15701, 12445, 4417, 721, 49, 1, 0, 1, 53218, 129214, 116698, 50944, 11452, 1288, 64, 1, 0, 1, 462331, 1191336, 1183216, 597026, 166716, 25956, 2136, 81, 1, 0
Offset: 0

Views

Author

Philippe Deléham, Nov 19 2011

Keywords

Comments

Row sums : A000142(n) = n!.

Examples

			Triangle begins :
1
1, 0
1, 1, 0
1, 4, 1, 0
1, 13, 9, 1, 0
1, 46, 56, 16, 1, 0
1, 199, 334, 160, 25, 1, 0
1, 1072, 2157, 1408, 365, 36, 1, 0
1, 6985, 15701, 12445, 4417, 721, 49, 1, 0
1, 53218, 129214, 116698, 50944, 11452, 1288, 64, 1, 0
		

Crossrefs

Programs

  • Mathematica
    DELTA[r_, s_, m_] := Module[{p, q, t, x, y}, q[k_] := x*r[[k + 1]] + y*s[[k + 1]]; p[0, ] = 1; p[, -1] = 0; p[n_ /; n >= 1, k_ /; k >= 0] := p[n, k] = p[n, k - 1] + q[k]*p[n - 1, k + 1] // Expand; t[n_, k_] := Coefficient[p[n, 0], x^(n - k)*y^k]; t[0, 0] = p[0, 0]; Table[t[n, k], {n, 0, m}, {k, 0, n}]];
    m = 10;
    DELTA[LinearRecurrence[{1, 1, -1}, {1, 0, 2}, m], LinearRecurrence[{0, 1}, {0, 1}, m], m] // Flatten (* Jean-François Alcover, Feb 21 2019 *)

Formula

Sum_{k=0..n} T(n,k)*x^k = (-1)^n*A172485(n+1), A146559(n), A000012(n), A000142(n), A003319(n), A111529(n), A111530(n), A111531(n), A111532(n), A111533(n) for x = -2,-1,0,1,2,3,4,5,6,7 respectively.
T(k+2,k)=(k+1)^2 = A000290(k+1).
T(n+1,1)= A014145(n).

A217988 Binomial transform of A215495(n).

Original entry on oeis.org

1, 2, 4, 10, 26, 66, 160, 372, 840, 1864, 4096, 8944, 19424, 41952, 90112, 192576, 409728, 868480, 1835008, 3866368, 8125952, 17038848, 35651584, 74449920, 155191296, 322963456, 671088640, 1392504832, 2885672960, 5972680704, 12348030976, 25501384704
Offset: 0

Views

Author

Paul Curtz, Oct 17 2012

Keywords

Comments

Companion to A218009.
Like any other sequence with a linear recurrence with constant coefficients, this sequence is periodic if read modulo some constant m. These Pisano period lengths for m>=1 are 1, 1, 8, 1, 20, 8, 168, 1, 24, 20, 440, 8, 156, 168, 40, 1, 272, 24, 1368, 20, ... [Curtz's comment reformulated and extended by R. J. Mathar, Oct 23 2012]
Let b(n) = a(n+1)-2*a(n), then b(n+3)-2*b(n+2) = A009545(n+2). - edited by Michel Marcus, Apr 24 2018

Examples

			a(n) and successive differences:
1, 2,  4, 10, 26,  66, 160, 372,  840, 1864, 4096, ...
1, 2,  6, 16, 40,  94, 212, 468, 1024, ...
1, 4, 10, 24, 54, 118, 256, ...
3, 6, 14, 30, 64, ...
3, 8, 16, ...
5, 8, ...
3, ...
		

Crossrefs

Programs

  • Magma
    I:=[1, 2, 4, 10, 26, 66]; [n le 6 select I[n] else 6*Self(n-1) - 14*Self(n-2) + 16*Self(n-3) - 8*Self(n-4): n in [1..40]]; // Vincenzo Librandi, Dec 15 2012
    
  • Mathematica
    a[n_] := Sum[ Binomial[n, k]*If[ OddQ[k], k, k/2 + Boole[ Mod[k, 4] == 0]], {k, 0, n}]; Table[ a[n], {n, 0, 31}] (* Jean-François Alcover, Oct 17 2012 *)
    CoefficientList[Series[(1-4*x+6*x^2-2*x^3-2*x^4+2*x^5)/((1-2*x)^2 * (1 - 2*x + 2*x^2)), {x, 0, 40}], x] (* Vincenzo Librandi, Dec 15 2012 *)
    LinearRecurrence[{6,-14,16,-8},{1,2,4,10,26,66},40] (* Harvey P. Dale, Aug 14 2018 *)
  • PARI
    x='x+O('x^30); Vec((1-4*x+6*x^2-2*x^3-2*x^4+2*x^5)/((1-2*x)^2*(1-2*x+2*x^2))) \\ G. C. Greubel, Apr 23 2018

Formula

a(n) = 6*a(n-1) - 14*a(n-2) + 16*a(n-3) - 8*a(n-4) with n > 5.
a(n) = A218009(n) + A146559(n).
G.f.: (1-4*x+6*x^2-2*x^3-2*x^4+2*x^5)/((1-2*x)^2*(1-2*x+2*x^2)). - Bruno Berselli, Oct 22 2012
a(n) = 2^(n-3)*(3*n+2)+((1+i)^n+(1-i)^n)/4, where i=sqrt(-1) and n>1, with a(0)=1, a(1)=2.

A348760 For any nonnegative number n with binary expansion Sum_{k >= 0} b_k * 2^k, a(n) is the real part of f(n) = Sum_{k >= 0} ((-1)^Sum_{j = 0..k-1} b_j) * (1+i)^k (where i denotes the imaginary unit); sequence A348761 gives the imaginary part.

Original entry on oeis.org

0, 1, 1, 0, 0, 1, 1, 0, -2, 3, 3, -2, 2, -1, -1, 2, -4, 5, 5, -4, 4, -3, -3, 4, 2, -1, -1, 2, -2, 3, 3, -2, -4, 5, 5, -4, 4, -3, -3, 4, 2, -1, -1, 2, -2, 3, 3, -2, 0, 1, 1, 0, 0, 1, 1, 0, -2, 3, 3, -2, 2, -1, -1, 2, 0, 1, 1, 0, 0, 1, 1, 0, -2, 3, 3, -2, 2, -1
Offset: 0

Views

Author

Rémy Sigrist, Oct 31 2021

Keywords

Comments

The function f defines a bijection from the nonnegative integers to the Gaussian integers.

Crossrefs

See A348690 for a similar sequence.

Programs

  • PARI
    a(n) = { my (v=0, k, o=-1); while (n, n-=2^k=valuation(n,2); v+=(1+I)^k * (-1)^o++); real(v) }

Formula

a(2^k) = A146559(k) for any k >= 0.

A373358 a(n) = 4*a(n-1) -5*a(n-2) +2*a(n-3) +2*a(n-4) for a(0) = a(1) = 0, a(2) = 1, a(3) = 4 for n >= 4.

Original entry on oeis.org

0, 0, 1, 4, 11, 26, 59, 136, 323, 782, 1903, 4620, 11175, 26970, 65051, 156944, 378811, 914566, 2208199, 5331476, 12871663, 31074802, 75020243, 181113240, 437244675, 1055602590, 2548453951, 6152518684, 14853499511, 35859517706, 86572518539, 209004522016, 504581529803, 1218167581622
Offset: 0

Views

Author

Paul Curtz, Jun 02 2024

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{4, -5, 2, 2}, {0, 0, 1, 4}, 50] (* Paolo Xausa, Jun 19 2024 *)
    nxt[{a_,b_,c_,d_}]:={b,c,d,4d-5c+2b+2a}; NestList[nxt,{0,0,1,4},40][[;;,1]] (* Harvey P. Dale, Jan 11 2025 *)
  • PARI
    a(n) = ((([2, 1; 1, 0]^(n+1))[2, 1]) - (1+I)^(n-1) - (1-I)^(n-1))/3 \\ Thomas Scheuerle, Jun 03 2024

Formula

G.f.: x^2 / ( (1 - 2*x - x^2) * (1 - 2*x + 2*x^2) ).
E.g.f.: exp(x)*(2*cosh(sqrt(2)*x) - 2*(cos(x)+sin(x)) + sqrt(2)*sinh(sqrt(2)*x))/6.
a(n) = A373245(n+1) - A114203(n+1).
a(0) = 0, a(n) = A373245(n-1) + A146559(n-1).
Binomial transform of 0, 0, followed by A077893 = abs(A077953) = abs(A077980).
a(n) = 4*a(n-1) -5*a(n-2) +2*a(n-3) +2*a(n-4) for n >= 4.
From Thomas Scheuerle, Jun 03 2024: (Start)
a(n) = (A000129(n+1) - A009545(n+1))/3.
a(n) = (-i*sqrt(2)*(1-i)^(n+1) + i*sqrt(2)*(1+i)^(n+1) - (1-sqrt(2))^(n+1) + (1+sqrt(2))^(n+1))/(6*sqrt(2)).
a(n) = 2^n*(hypergeom([1/2 - n/2, -n/2], [-n], -1) - hypergeom([1/2 - n/2, -n/2], [-n], 2))/3. (End)

A102486 a(n) = 4*a(n-1) - 5*a(n-2).

Original entry on oeis.org

2, 6, 14, 26, 34, 6, -146, -614, -1726, -3834, -6706, -7654, 2914, 49926, 185134, 490906, 1037954, 1697286, 1599374, -2088934, -16352606, -54965754, -138099986, -277571174, -419784766, -291283194, 933791054, 5191580186, 16097365474, 38431560966, 73239416494, 100799861146
Offset: 0

Views

Author

N. J. A. Sloane, Feb 25 2005

Keywords

Comments

Inverse binomial transform is 2,4,4,0,-8,-16,-16,.. essentially -A146559(n+3). - R. J. Mathar, Apr 07 2022

References

  • B. M. E. Moret and H. D. Shapiro, Algorithms from P to NP, Benjamin/Cummings, Vol. 1, 1991; p. 65.

Crossrefs

Cf. A099456.

Programs

  • Magma
    I:=[2, 6]; [n le 2 select I[n] else 4*Self(n-1)-5*Self(n-2): n in [1..40]]; // Vincenzo Librandi, Jan 15 2012
    
  • Maple
    a := proc(n) option remember; if n = 0 then RETURN(2) end if; if n = 1 then RETURN(6) end if; 4*a(n - 1) - 5*a(n - 2); end proc;
  • Mathematica
    Column[LinearRecurrence[{4,-5},{2,6},40]] (* Vincenzo Librandi, Jan 15 2012 *)
  • PARI
    Vec(2*(1-x)/(1-4*x+5*x^2)+O(x^99)) \\ Charles R Greathouse IV, Jan 15 2012

Formula

G.f.: 2*(1-x)/(1-4*x+5*x^2). [Colin Barker, Jan 14 2012]
Previous Showing 21-30 of 36 results. Next