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-3 of 3 results.

A077868 Expansion of 1/((1-x)*(1-x-x^3)).

Original entry on oeis.org

1, 2, 3, 5, 8, 12, 18, 27, 40, 59, 87, 128, 188, 276, 405, 594, 871, 1277, 1872, 2744, 4022, 5895, 8640, 12663, 18559, 27200, 39864, 58424, 85625, 125490, 183915, 269541, 395032, 578948, 848490, 1243523, 1822472, 2670963, 3914487, 5736960, 8407924, 12322412
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Comments

Row sums of Riordan array (1/(1-x), x*(1+x^2)). - Paul Barry, Feb 16 2005
a(n) is the number of partitions of {1, ..., n+3} into two blocks in which only 1- or 3-strings of consecutive integers can appear in a block and there is at least one 3-string. E.g., a(3)=5 because the enumerated partitions of {1,2,3,4,5,6} are 1235/46, 1345/26, 15/2346, 13/2456, 123/456. - Augustine O. Munagi, Apr 11 2005

References

  • Chu, Hung Viet. "Various Sequences from Counting Subsets." Fib. Quart., 59:2 (May 2021), 150-157.

Crossrefs

Programs

  • Magma
    A077868:= func< n | n eq 0 select 0 else (&+[Binomial(n-2*j+, j+1): j in [0..Floor((n+1)/3)]]) >;
    [A077868(n): n in [0..40]]; // G. C. Greubel, Jul 27 2022
    
  • Maple
    a:= n-> (Matrix(4, (i,j)-> if i=j-1 then 1 elif j=1 then [2,-1,1,-1][i] else 0 fi)^n)[1,1]: seq(a(n), n=0..41); # Alois P. Heinz, Sep 05 2008
    g:=(1+z+z^2)/(1-z-z^3): gser:=series(g, z=0, 43): seq(coeff(gser, z, n)-1, n=1..42); # Zerinvary Lajos, Jan 09 2009
  • Mathematica
    LinearRecurrence[{1,1,0,0,-1}, {1,2,3,5,8,12}, 42] (* or *)
    CoefficientList[Series[1/((1-x)(1-x-x^3)), {x, 0, 41}], x] (* Michael De Vlieger, Jun 06 2018 *)
  • PARI
    Vec(1/(1-x)/(1-x-x^3)+O(x^99)) \\ Charles R Greathouse IV, Sep 23 2012
    
  • PARI
    {a = vector(50);
    a[1] = 1; a[2] = 2; a[3] = 3;
    for(n=4,50,
    a[n] = 1 + a[n-1] + a[n-3];
    ); a} \\ Gerry Martens, Jun 03 2018
    
  • PARI
    {a(n) = if( n<0, n=-4-n; polcoeff( -1 / (1 - x) / (1 + x^2 - x^3) + x * O(x^n), n), polcoeff( 1 / (1 - x) / (1 - x - x^3) + x * O(x^n), n))}; /* Michael Somos, Jun 17 2018 */
    
  • SageMath
    def A077868(n): return sum(binomial(n-2*j+1, j+1) for j in (0..((n+1)//3)))
    [A077868(n) for n in (0..40)] # G. C. Greubel, Jul 27 2022

Formula

Partial sums of A000930. a(n-1) = Sum_{k=0..floor(n/2)} binomial(n-2*k, k+1). - Paul Barry, Jul 07 2004
a(n-3) = Sum(binomial(n-r, r)), r=1, 2, ... which is the case t=3 and k=2 in the general case of t-strings and k blocks: a(n-3, k, t) = Sum(binomial(n-r*(t-1), r)*S2(n-r*(t-1)-1, k-1)), r=1, 2, ... - Augustine O. Munagi, Apr 11 2005
From Paul Weisenhorn, Oct 28 2011: (Start)
a(n) = a(n-1) + a(n-2) - a(n-5) for n > 4.
a(n) = a(n-2) + a(n-3) + a(n-4) + 2 for n > 3.
G.f.: 1/((1-x)*(1-x-x^3)). (End)
a(n) = 1 + a(n-1) + a(n-3), a(1)=1, a(2)=2, a(3)=3. - Gerry Martens, Jun 10 2018
a(n) = -A077888(-4-n) for all n in Z. - Michael Somos, Jun 17 2018
a(n) = A000930(n+3) - 1. - Greg Dresden, Jun 20 2021
a(n) = A099567(n+3, 4). - G. C. Greubel, Jul 27 2022

Extensions

More terms from Augustine O. Munagi, Apr 11 2005

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

Original entry on oeis.org

1, -2, 3, -3, 1, 4, -12, 21, -26, 19, 9, -63, 136, -200, 201, -66, -269, 805, -1407, 1740, -1268, -611, 4230, -9117, 13393, -13439, 4368, 18096, -53999, 94270, -116445, 84621, 41473, -284012, 611172, -896859, 898534, -289037, -1217319, 3622209, -6316136, 7792744, -5647143, -2814594
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Crossrefs

Cf. A077941.

Programs

  • GAP
    a:=[1,-2,3];; for n in [4..50] do a[n]:=-2*a[n-1]-a[n-2]+a[n-3]; od; a; # G. C. Greubel, Jun 26 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 50); Coefficients(R!( 1/(1+2*x+x^2-x^3) )); // G. C. Greubel, Jun 26 2019
    
  • Maple
    A077990 := proc(n)
        option remember ;
        if n <=2 then
            (-1)^n*(n+1) ;
        else
            -2*procname(n-1)-procname(n-2)+procname(n-3) ;
        end if;
    end proc:
    seq(A077990(n),n=0..20) ; # R. J. Mathar, Feb 25 2024
  • Mathematica
    CoefficientList[Series[1/(1+2x+x^2-x^3),{x,0,50}],x] (* or *) LinearRecurrence[ {-2,-1,1},{1,-2,3},50] (* Harvey P. Dale, Aug 10 2016 *)
  • PARI
    Vec(1/(1+2*x+x^2-x^3)+O(x^50)) \\ Charles R Greathouse IV, Sep 26 2012
    
  • Sage
    (1/(1+2*x+x^2-x^3)).series(x, 50).coefficients(x, sparse=False) # G. C. Greubel, Jun 26 2019
    

Formula

From Paul Barry, May 10 2005: (Start)
G.f.: 1/((1+x)^2-x^3).
a(n) = Sum_{k=0..n+4} (-1)^(n-k-1)*C(n+3, k)*Sum_{j=0..floor(k/3)} C(k-2j, j). (End)
a(n) = (-1)^n * A077941(n). - G. C. Greubel, Jun 26 2019

A000253 a(n) = 2*a(n-1) - a(n-2) + a(n-3) + 2^(n-1).

Original entry on oeis.org

0, 1, 4, 11, 27, 63, 142, 312, 673, 1432, 3015, 6295, 13055, 26926, 55284, 113081, 230572, 468883, 951347, 1926527, 3894878, 7863152, 15855105, 31936240, 64269135, 129234351, 259690239, 521524126, 1046810092, 2100221753, 4212028452, 8444387067
Offset: 0

Views

Author

Jason Howald (jahowald(AT)umich.edu)

Keywords

Comments

From Holger Petersen (petersen(AT)informatik.uni-stuttgart.de), May 29 2006: (Start)
Also number of binary strings of length n+2 containing the pattern 010. Proof: Clear for n = 0, 1, 2. For n > 2 each string with pattern 010 of length n-1 gives 2 strings of length n with the property by appending a symbol. In addition each string of length n-1 without 010 and ending in 01 contributes one new string. Denote by c_w(m) the number of strings of length m without 010 and ending in w.
Since there is a total of 2^m strings of length m, we have c_01(m) = c_0(m-1) = (2^{m-1} - a(m-3)) - c_1(m-1) = (2^{m-1} - a(m-3)) - (2^{m-2} - a(m-4)) = 2^{m-2} - a(m-3) + a(m-4) (the first and third equalities follow from the fact that appending a 1 will not generate the pattern). The recurrence is a(n) = 2a(n-1) + c_01(n+1) = 2a(n-1) + 2^{n-1} - a(n-2) + a(n-3).
(End)

Programs

  • Maple
    f := proc(n) option remember; if n<=1 then n else if n<=3 then 7*n-10; else 2*f(n-1)-f(n-2)+f(n-3)+2^(n-1); fi; fi; end;
    # second Maple program:
    a:= n-> (<<0|1|0|0>, <0|0|1|0>, <0|0|0|1>, <-2|3|-5|4>>^n)[3, 4]:
    seq(a(n), n=0..30);  # Alois P. Heinz, Mar 27 2017
  • Mathematica
    nn=50; a=x^2/(1-x)^2; Drop[CoefficientList[Series[a x/(1-a x)/(1-2x), {x,0,nn}], x], 2] (* Geoffrey Critzer, Nov 26 2013 *)
    LinearRecurrence[{4, -5, 3, -2}, {0, 1, 4, 11}, 32] (* Jean-François Alcover, Feb 06 2016 *)

Formula

From Ralf Stephan, Aug 19 2004: (Start)
a(n) = (1/3)*(4*2^n + A077941(n-1) - 2*A077941(n+1)).
G.f.: x/((1-2*x)*(1 - 2*x + x^2 - x^3)). (End)
a(n) = A000079(n+2) - A005251(n+5). - Alois P. Heinz, Apr 03 2012
Showing 1-3 of 3 results.