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 41-50 of 51 results. Next

A062000 a(n) = a(n-1)^2 - a(n-2)^2 with a(0) = 0, a(1) = 2.

Original entry on oeis.org

0, 2, 4, 12, 128, 16240, 263721216, 69548879504781056, 4837046640370554355727482727956480, 23397020201120067002755280700388456275000098577861376610994277515264
Offset: 0

Views

Author

Henry Bottomley, May 29 2001

Keywords

Examples

			a(3) = 4^2 - 2^2 = 12.
		

Crossrefs

Cf. A001042 and A057078 have the same recurrence.
Cf. A061999.

Programs

  • Mathematica
    t = {0, 2}; Do[AppendTo[t, t[[-2]]^2 - t[[-1]]^2], {n, 8}]; Abs[t] (* Vladimir Joseph Stephan Orlovsky, Feb 23 2012 *)
    RecurrenceTable[{a[0]==0, a[1]==2, a[n]==a[n-1]^2 - a[n-2]^2}, a, {n, 0, 10}] (* Vaclav Kotesovec, Dec 17 2014 *)
  • PARI
    { for (n=0, 12, if (n>1, a=a1^2 - a2^2; a2=a1; a1=a, if (n==0, a=a2=0, a=a1=2)); write("b062000.txt", n, " ", a) ) } \\ Harry J. Smith, Jul 29 2009
    
  • SageMath
    def a(n): # a = A062000
        if (n<2): return 2*n
        else: return a(n-1)^2 - a(n-2)^2
    [a(n) for n in (0..14)] # G. C. Greubel, May 01 2022

Formula

a(n) = 2*A061999(n).
a(n) ~ c^(2^n), where c = 1.35388068260888709216374860554901303232201699191445590979673901150215855854... . - Vaclav Kotesovec, Dec 17 2014

Extensions

First term corrected by Harry J. Smith, Jul 29 2009

A122918 Expansion of (1+x)^2/(1+x+x^2)^2.

Original entry on oeis.org

1, 0, -2, 2, 1, -4, 3, 2, -6, 4, 3, -8, 5, 4, -10, 6, 5, -12, 7, 6, -14, 8, 7, -16, 9, 8, -18, 10, 9, -20, 11, 10, -22, 12, 11, -24, 13, 12, -26, 14, 13, -28, 15, 14, -30, 16, 15, -32, 17, 16, -34, 18, 17, -36, 19, 18, -38
Offset: 0

Views

Author

Paul Barry, Sep 19 2006

Keywords

Comments

Row sums of Riordan array (1/(1+x+x^2), x/(1+x)^2), A122917.
For n>=1, a(n) equals (-1)^(n+1) times the second immanant of the n X n matrix with 1's along the main diagonal, superdiagonal, and subdiagonal, and 0's everywhere else. The second immanant of an n X n matrix A is the immanant of A given by the partition (2, 1^(n-2)). - John M. Campbell, Apr 12 2014

Crossrefs

Cf. A187430 (series reversion, with offset 1).

Programs

  • Mathematica
    CoefficientList[Series[(1 + x)^2/(1 + x + x^2)^2, {x, 0, 100}], x] (* Vincenzo Librandi, Apr 13 2014 *)
    Print[Table[(-1)^(n+1)*Sum[Binomial[n-i, i]*(n-2*i-1)*(-1)^i, {i, 0, Floor[n/2]}], {n, 0, 100}]] ;  (* John M. Campbell, Jan 08 2016 *)
  • PARI
    Vec((1+x)^2/(1+x+x^2)^2 + O(x^100)) \\ Altug Alkan, Jan 08 2015
    
  • PARI
    A122918(n)=(-1)^(n+1)*sum(i=0,n\2,(-1)^i*binomial(n-i,i)*(n-2*i-1)) \\ M. F. Hasler, Jan 12 2016

Formula

a(n) = 4 * sqrt(3) * cos(2*Pi*n/3 + Pi/6)/9 + 2(n+1) * sin(2*Pi*n/3 + Pi/6)/3. a(n) = sum{k=0..n} A057078(k) * A057078(n-k).
a(n) = (-1)^(n+1)*sum((-1)^i*binomial(n-i,i)*(n-2*i-1), i=0..[n/2]). - John M. Campbell, Jan 08 2016

A138187 Hankel transform of binomial(2*n+3, n).

Original entry on oeis.org

1, -4, 3, 3, -8, 5, 5, -12, 7, 7, -16, 9, 9, -20, 11, 11, -24, 13, 13, -28, 15, 15, -32, 17, 17, -36, 19, 19, -40, 21, 21, -44, 23, 23, -48, 25, 25, -52, 27, 27, -56, 29, 29, -60, 31, 31, -64, 33, 33, -68, 35, 35, -72, 37, 37, -76, 39, 39, -80, 41
Offset: 0

Views

Author

Paul Barry, Mar 04 2008

Keywords

Comments

Hankel transform of A002054(n+1).
Hankel transform of A002054(n) is A057078(n+1).
Partial sums are A138188.

Crossrefs

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 65); Coefficients(R!( (1-2*x-2*x^2-x^3)/(1+x+x^2)^2 )); // G. C. Greubel, Jun 16 2021
    
  • Mathematica
    a[n_]:= a[n]= Sum[(-1)^(n-k+1)*(n+k+2)*Binomial[n+k+1, 2*k], {k, 0, n+1}];
    Table[a[n], {n, 0, 65}] (* G. C. Greubel, Jun 16 2021 *)
  • Sage
    @CachedFunction
    def A138187(n):
        if (n%3==0): return 2*(n//3) +1
        elif (n%3==1): return -4*((n//3) +1)
        else: return 2*(n//3) +3
    [A138187(n) for n in (0..65)] # G. C. Greubel, Jun 16 2021

Formula

G.f.: (1 -2*x -2*x^2 -x^3)/(1 +x +x^2)^2.
a(n) = Sum_{k=0..n} (-1)^(n-k+1)*(n+k+2)*binomial(n+k+1, 2*k). - Paul Barry, Apr 19 2010
a(n) = 2*floor(n/3) + 1 if (n mod 3) = 0, -4*(floor(n/3) + 1) if (n mod 3) = 1 and 2*floor(n/3) + 3 if (n mod 3) = 2. - G. C. Greubel, Jun 16 2021

A360705 Expansion of Sum_{k>=0} (x * (1 + (-1)^k * x))^k.

Original entry on oeis.org

1, 1, 0, 3, -1, 8, 1, 21, 0, 55, -1, 144, 1, 377, 0, 987, -1, 2584, 1, 6765, 0, 17711, -1, 46368, 1, 121393, 0, 317811, -1, 832040, 1, 2178309, 0, 5702887, -1, 14930352, 1, 39088169, 0, 102334155, -1, 267914296, 1, 701408733, 0, 1836311903, -1, 4807526976, 1
Offset: 0

Views

Author

Seiichi Manyama, Feb 17 2023

Keywords

Crossrefs

Programs

  • PARI
    my(N=50, x='x+O('x^N)); Vec(sum(k=0, N, (x*(1+(-1)^k*x))^k))
    
  • PARI
    a(n) = sum(k=0, n\2, (-1)^(k*(n-k))*binomial(n-k, k));
    
  • PARI
    a(n) = if(n%2, fibonacci(n+1), [1, 0, -1][n/2%3+1]);

Formula

a(n) = Sum_{k=0..floor(n/2)} (-1)^(k*(n-k)) * binomial(n-k,k).
a(2*n) = A057078(n), a(2*n+1) = A000045(2*n+2).
G.f.: ( 1+x+x^3-2*x^4+x^5+x^6-2*x^2 ) / ( (x^2-x-1)*(x^2+x-1)*(1+x+x^2)*(x^2-x+1) ). - R. J. Mathar, Mar 12 2023

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

Original entry on oeis.org

1, -1, 2, 0, 2, 2, 5, 5, 12, 16, 28, 44, 73, 115, 190, 304, 494, 798, 1293, 2089, 3384, 5472, 8856, 14328, 23185, 37511, 60698, 98208, 158906, 257114, 416021, 673133, 1089156, 1762288, 2851444, 4613732, 7465177, 12078907, 19544086, 31622992, 51167078, 82790070
Offset: 0

Views

Author

Seiichi Manyama, Aug 13 2024

Keywords

Crossrefs

Programs

  • PARI
    my(N=50, x='x+O('x^N)); Vec(1/((1+x)*(1-x^2*(1+x)^2)))
    
  • PARI
    a(n) = sum(k=0, n\2, binomial(2*k-1, n-2*k));

Formula

a(n) = -a(n-1) + a(n-2) + 3*a(n-3) + 3*a(n-4) + a(n-5).
a(n) = Sum_{k=0..floor(n/2)} binomial(2*k-1,n-2*k).
a(n) = A375373(n) + A375373(n-1).
2*a(n) = 2*(-1)^n + A000045(n) + A057078(n+1). - R. J. Mathar, Aug 14 2024

A005289 Number of graphs on n nodes with 3 cliques.

Original entry on oeis.org

0, 0, 1, 4, 12, 31, 67, 132, 239, 407, 657, 1019, 1523, 2211, 3126, 4323, 5859, 7806, 10236, 13239, 16906, 21346, 26670, 33010, 40498, 49290, 59543, 71438, 85158, 100913, 118913, 139398, 162609, 188817, 218295, 251349, 288285
Offset: 1

Views

Author

Keywords

References

  • R. K. Guy, personal communication.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Programs

  • Maple
    A005289p := proc(n)
        n*(2*n^2+3*n-6)/72 ;
        round(%) ;
    end proc:
    A005289 := proc(n)
        if type(n,'even') then
            n*(n^2-4)*(n^2-6)/240+A005289p(n) ;
        else
            n*(n^2-1)*(n^2-9)/240+A005289p(n) ;
        end if;
    end proc:
    seq(A005289(n),n=1..40) ; # R. J. Mathar, Aug 23 2015
  • Mathematica
    s = x^2*(3*x^3+x^2+x+1) / ((x-1)^6*(x+1)^2*(x^2+x+1)) + O[x]^40; CoefficientList[s, x] (* Jean-François Alcover, Nov 27 2015 *)

Formula

G.f.: x^3*(1+x+3*x^3+x^2) / ( (1+x+x^2)*(1+x)^2*(x-1)^6 ). - Simon Plouffe in his 1992 dissertation
288*a(n) = -4*n^3+12*n^2-21*n/5-14+6*n^5/5+(-1)^n*9*(n-2) +32*A057078(n). - R. J. Mathar, Jul 30 2024

A131640 First differences are periodic: 50, 50, 75, 50, 50, 75, ...

Original entry on oeis.org

985, 1035, 1085, 1160, 1210, 1260, 1335, 1385, 1435, 1510, 1560, 1610, 1685, 1735, 1785, 1860, 1910, 1960, 2035, 2085, 2135, 2210, 2260, 2310, 2385, 2435, 2485, 2560, 2610, 2660, 2735, 2785, 2835, 2910, 2960, 3010, 3085, 3135, 3185, 3260, 3310, 3360
Offset: 0

Views

Author

Eric M. Adler (eadler(AT)simi.k12.ca.us), Sep 05 2007

Keywords

Crossrefs

Programs

  • Magma
    A131640:= func< n | (5/3)*(35*n + 591 - 5*(n mod 3) ) >;
    [A131640(n): n in [0..50]]; // G. C. Greubel, Sep 08 2025
    
  • Maple
    A131640 := proc(n) option remember ; if n =0 then 985 ; elif n mod 3 = 0 then A131640(n-1)+75 ; else A131640(n-1)+50 ; fi ; end: seq(A131640(n),n=0..80) ; # R. J. Mathar, Oct 24 2007
  • Mathematica
    LinearRecurrence[{1,0,1,-1},{985,1035,1085,1160},50] (* Ray Chandler, Aug 25 2015 *)
    Table[5*(35*n +591 -5*Mod[n,3])/3, {n,0,50}] (* G. C. Greubel, Sep 08 2025 *)
  • PARI
    Vec(5*(197+10*x+10*x^2-182*x^3)/((1-x)^2*(1+x+x^2)) + O(x^40)) \\ Andrew Howroyd, Feb 20 2018
    
  • SageMath
    def A131640(n): return 5*(35*n + 591 - 5*(n%3))//3
    print([A131640(n) for n in range(51)]) # G. C. Greubel, Sep 08 2025

Formula

G.f.: 5*(197 + 10*x + 10*x^2 - 182*x^3)/((1-x)^2*(1+x+x^2)). - R. J. Mathar, Nov 14 2007
From G. C. Greubel, Sep 08 2025: (Start)
a(n) = (5/3)*(35*(n+1) + 551 + 5*(A102283(n+1) + A102283(n))).
a(n) = (5/3)*(35*n + 586 + 5*A057078(n)).
E.g.f.: (5/3)*( 5*exp(-x/2)*( cos((sqrt(3)*x)/2) + (1/sqrt(3))*sin((sqrt(3)*x)/2)) + (586 + 35*x)*exp(x) ). (End)

Extensions

Definition supplied by N. J. A. Sloane, Sep 14 2007
More terms from R. J. Mathar, Oct 24 2007

A146994 a(n) = (n+1)^2/4 + (floor((n+5)/6) - 1/4) * ((n+1) mod 2).

Original entry on oeis.org

1, 3, 4, 7, 9, 13, 16, 22, 25, 32, 36, 44, 49, 59, 64, 75, 81, 93, 100, 114, 121, 136, 144, 160, 169, 187, 196, 215, 225, 245, 256, 278, 289, 312, 324, 348, 361, 387, 400, 427, 441, 469, 484, 514, 529, 560, 576, 608, 625, 659, 676, 711, 729, 765, 784, 822, 841
Offset: 1

Views

Author

Mitch Phillipson, Manda Riehl, and Tristan Williams, Nov 04 2008

Keywords

Comments

This sum appears when calculating the number of elements of S_3 wreath C_k which avoid 12. We use a nonstandard ordering, where we consider an element of S_3 wreath C_k to be a permutation sigma of S_3 with each sigma_i colored one of k colors. We then create a string au with au_i being defined as sigma_i times its color (where, e.g., the 3rd color has value 3). We then consider the reduced string of au identically to reducing permutations as done in standard pattern avoidance. When calculating the number of these reduced strings which avoid 12, we encounter this sequence as one of our subcases.

Crossrefs

Programs

  • Magma
    [(n mod 2) eq 0 select n*(n+2)/4 + Floor((n+5)/6) else (n+1)^2/4: n in [1..60]]; // G. C. Greubel, Jan 09 2020
    
  • Maple
    a := n -> `if`(irem(n,2)=1,(n+1)^2/4, ((n+1)^2-1)/4 + floor((n+5)/6)): seq(a(n), n=1..57); # Peter Luschny, Feb 01 2015
  • Mathematica
    LinearRecurrence[{1,1,-1,0,0,1,-1,-1,1},{1,3,4,7,9,13,16,22,25},60] (* Harvey P. Dale, Dec 17 2012 *)
    Table[If[EvenQ[n], n*(n+2)/4 + Floor[(n+5)/6], (n+1)^2/4], {n, 60}] (* G. C. Greubel, Jan 09 2020 *)
  • PARI
    a(n) = if(n%2==0, n*(n+2)/4 + (n+5)\6, (n+1)^2/4);
    vector(60, n, a(n)) \\ G. C. Greubel, Jan 09 2020
    
  • Sage
    def a(n):
        if (mod(n,2)==0): return n*(n+2)/4 + floor((n+5)/6)
        else: return (n+1)^2/4
    [a(n) for n in (1..60)] # G. C. Greubel, Jan 09 2020

Formula

a(2*n-1) = n^2 for n >= 1.
a(2*n) = n*(n+1) + floor((2*n+5)/6) for n >= 0.
From R. J. Mathar, Nov 21 2008: (Start)
a(n) = (-4*A057078(n) - 4*A010892(n+1) + 6*n^2 + 14*n + 7 + (-1)^n*(2n+1))/24.
a(n) = a(n-1) + a(n-2) - a(n-3) + a(n-6) - a(n-7) - a(n-8) + a(n-9).
G.f.: x*(1 + 2*x + x^3 + x^4 + x^5)/((1 + x + x^2)*(1 - x + x^2)*(1+x)^2*(1-x)^3). (End)

Extensions

More terms from R. J. Mathar, Nov 21 2008
Name corrected and partial edit by Peter Luschny, Feb 01 2015

A164360 Period 3: repeat [5, 4, 3].

Original entry on oeis.org

5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, 4, 3
Offset: 0

Views

Author

Stephen Crowley, Aug 14 2009

Keywords

Comments

From Klaus Brockhaus, May 29 2010: (Start)
Continued fraction expansion of (32+sqrt(1297))/13.
Decimal expansion of 181/333. (End)

Crossrefs

Cf. A007877 (repeat 0,1,2,1), A068073 (repeat 1,2,3,2), A028356 (repeat 1,2,3,4,3,2), A130784 (repeat 1,3,2), A158289 (repeat 0,1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2,1).
Cf. A178566 (decimal expansion of (32+sqrt(1297))/13). [Klaus Brockhaus, May 29 2010]

Programs

Formula

a(n) = 4+(-1)^n*((1/2+I*sqrt(3)/6)*((1+I*sqrt(3))/2)^n+(1/2-I*sqrt(3)/6)*((1-I*sqrt(3))/2)^n). [Corrected by Klaus Brockhaus, Sep 17 2009]
a(n) = 4+(1/3)*sqrt(3)*sin(2*n*Pi/3)+cos(2*n*Pi/3). [Corrected by Klaus Brockhaus, Sep 17 2009]
a(n) = a(n-3) for n > 2, with a(0) = 5, a(1) = 4, a(2) = 3.
G.f.: (5+4*x+3*x^2)/((1-x)*(1+x+x^2)). [Klaus Brockhaus, Sep 17 2009]
E.g.f.: 4*exp(x)+(1/3)*sqrt(3)*exp(-(1/2)*x)*sin((1/2)*x*sqrt(3))+exp(-(1/2)*x)*cos((1/2)*x*sqrt(3)).
a(n) = 4 + A057078(n). - Wesley Ivan Hurt, Jul 01 2016

Extensions

Edited by Klaus Brockhaus, Sep 17 2009
Offset changed to 0 and formulas adjusted by Klaus Brockhaus, May 18 2010

A191272 Expansion of x*(4+5*x)/( (1-4*x)*(1 + x + x^2) ).

Original entry on oeis.org

0, 4, 17, 63, 256, 1025, 4095, 16384, 65537, 262143, 1048576, 4194305, 16777215, 67108864, 268435457, 1073741823, 4294967296, 17179869185, 68719476735, 274877906944, 1099511627777, 4398046511103, 17592186044416, 70368744177665
Offset: 0

Views

Author

Paul Curtz, May 29 2011

Keywords

Programs

  • Magma
    m:=24; R:=PowerSeriesRing(Integers(), m); [0] cat Coefficients(R!(x*(4+5*x)/((1-4*x)*(1+x+x^2))));  // Bruno Berselli, Jul 04 2011
    
  • Mathematica
    LinearRecurrence[{3,3,4},{0,4,17},30] (* or *) CoefficientList[ Series[ x (4+5x)/((1-4x)(1+x+x^2)),{x,0,30}],x] (* Harvey P. Dale, Jun 19 2011 *)
  • Maxima
    makelist(coeff(taylor(x*(4+5*x)/((1-4*x)*(1+x+x^2)), x, 0, n), x, n), n, 0, 23);  /* Bruno Berselli, Jun 06 2011 */
  • PARI
    a(n)=4^n-[1,0,-1][n%3+1] \\ Charles R Greathouse IV, Jun 06 2011
    

Formula

G.f.: x*(4+5*x)/(1 - 3*x - 3*x^2 - 4*x^3).
a(n) = 4^n-A057078(n) = 4^n - (n-th element of periodic length 3 repeat 1, 0, -1)
a(n) = A024495(2*n) + A024495(1+2*n).
a(n+1) = 4*a(n) + (n-th element of periodic length 3 repeat 4, 1, -5).
a(n) = A052539(n) - A080425(n+1). - Bruno Berselli, Jun 06 2011
a(0)=0, a(1)=4, a(2)=17, a(n) = 3*a(n-1) + 3*a(n-2) + 4*a(n-3). - Harvey P. Dale, Jun 19 2011
a(n) = 4*a(n-1) + a(n-3) - 4*(n-4) (n>3). - Bruno Berselli, Jul 04 2011
Previous Showing 41-50 of 51 results. Next