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

A344002 Erroneous version of A077868 (if initial 0 is ignored).

Original entry on oeis.org

0, 1, 2, 3, 5, 8, 12, 18, 27, 30, 49, 77, 118
Offset: 0

Views

Author

N. J. A. Sloane, Jun 02 2021

Keywords

Comments

Included in accordance with OEIS rule of including published but erroneous sequences in order to serve as pointers to the correct versions.

References

  • Chu, Hung Viet. "Various Sequences from Counting Subsets." Fib. Quart., 59:2 (May 2021), 150-157. [But beware errors.] [Note: there is a different paper on the arXiv with the same author and tile, but it lacks the sequences. Do not replace this reference with a link to the arXiv version.]

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

Original entry on oeis.org

1, 2, 4, 6, 9, 13, 18, 25, 34, 46, 62, 83, 111, 148, 197, 262, 348, 462, 613, 813, 1078, 1429, 1894, 2510, 3326, 4407, 5839, 7736, 10249, 13578, 17988, 23830, 31569, 41821, 55402, 73393, 97226, 128798, 170622, 226027, 299423, 396652, 525453, 696078, 922108
Offset: 1

Views

Author

Ed Pegg Jr, Oct 16 2010

Keywords

Comments

Number of wins in Penney's game if the two players start HHT and TTT and HHT beats TTT.
HHT beats TTT 70% of the time. - Geoffrey Critzer, Mar 01 2014

Examples

			a(n) enumerates length n+2 sequences on {H,T} that end in HHT but do not contain the contiguous subsequence TTT.
a(3)=4 because we have: TTHHT, THHHT, HTHHT, HHHHT.
a(4)=6 because we have: TTHHHT, THTHHT, THHHHT, HTTHHT, HTHHHT, HHHHHT. - _Geoffrey Critzer_, Mar 01 2014
		

Crossrefs

Related sequences are A000045 (HHH beats HHT, HTT beats TTH), A006498 (HHH beats HTH), A023434 (HHH beats HTT), A000930 (HHH beats THT, HTH beats HHT), A000931 (HHH beats TTH), A077868 (HHT beats HTH), A002620 (HHT beats HTT), A000012 (HHT beats THH), A004277 (HHT beats THT), A070550 (HTH beats HHH), A000027 (HTH beats HTT), A097333 (HTH beats THH), A040000 (HTH beats TTH), A068921 (HTH beats TTT), A054405 (HTT beats HHH), A008619 (HTT beats HHT), A038718 (HTT beats THT), A128588 (HTT beats TTT).
Cf. A164315 (essentially the same sequence).

Programs

  • Maple
    A171861 := proc(n) option remember; if n <=4 then op(n,[1,2,4,6]); else procname(n-1)+procname(n-2)-procname(n-4) ; end if; end proc:
  • Mathematica
    nn=44;CoefficientList[Series[x(1+x+x^2)/(1-x-x^2+x^4),{x,0,nn}],x] (* Geoffrey Critzer, Mar 01 2014 *)
  • PARI
    a(n)=([0,1,0,0; 0,0,1,0; 0,0,0,1; -1,0,1,1]^(n-1)*[1;2;4;6])[1,1] \\ Charles R Greathouse IV, Oct 03 2016

Formula

a(n) = a(n-1) +a(n-2) -a(n-4) = A000931(n+10)-3 = A134816(n+6)-3 = A078027(n+12)-3.
a(n) = A164315(n-1). - Alois P. Heinz, Oct 12 2017

A099567 Riordan array (1/(1-x-x^3), 1/(1-x)).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 2, 3, 3, 1, 3, 5, 6, 4, 1, 4, 8, 11, 10, 5, 1, 6, 12, 19, 21, 15, 6, 1, 9, 18, 31, 40, 36, 21, 7, 1, 13, 27, 49, 71, 76, 57, 28, 8, 1, 19, 40, 76, 120, 147, 133, 85, 36, 9, 1, 28, 59, 116, 196, 267, 280, 218, 121, 45, 10, 1, 41, 87, 175, 312, 463, 547, 498, 339, 166, 55, 11, 1
Offset: 0

Views

Author

Paul Barry, Oct 22 2004

Keywords

Comments

Inverse matrix is A099569.
Subtriangle of the triangle in A144903. - Philippe Deléham, Dec 29 2013

Examples

			Rows begin:
   1;
   1,  1;
   1,  2,   1;
   2,  3,   3,   1;
   3,  5,   6,   4,   1;
   4,  8,  11,  10,   5,   1;
   6, 12,  19,  21,  15,   6,   1;
   9, 18,  31,  40,  36,  21,   7,   1;
  13, 27,  49,  71,  76,  57,  28,   8,   1;
  19, 40,  76, 120, 147, 133,  85,  36,   9,   1;
  28, 59, 116, 196, 267, 280, 218, 121,  45,  10,   1;
		

Crossrefs

Programs

  • Magma
    T:= func< n,k | (&+[Binomial(n-2*j, k+j): j in [0..Floor(n/3)]]) >;
    [[T(n,k): k in [0..n]]: n in [0..15]]; // G. C. Greubel, Jul 27 2022
    
  • Mathematica
    T[n_, 0]:=T[n,0]=HypergeometricPFQ[{(1-n)/3,(2-n)/3,-n/3}, {(1-n)/2,-n/2}, -27/4];
    T[n_, k_]:= T[n,k]= If[k==n, 1, T[n-1,k-1] +T[n-1,k]];
    Table[T[n, k], {n,0,15}, {k,0,n}]//Flatten (* G. C. Greubel, Apr 28 2017 *)
  • SageMath
    @CachedFunction
    def A099567(n, k): return sum( binomial(n-2*j, k+j) for j in (0..(n//3)) )
    flatten([[A099567(n,k) for k in (0..n)] for n in (0..15)]) # G. C. Greubel, Jul 27 2022

Formula

Number triangle T(n, k) = Sum_{j=0..floor(n/3)} binomial(n-2*j, k+j).
Columns have g.f. (1/(1-x-x^3))*(x/(1-x))^k.
Sum_{k=0..n} T(n, k) = A099568(n).
T(n,0) = A000930(n), T(n,n) = 1, T(n,k) = T(n-1,k-1) + T(n-1,k) for 0Philippe Deléham, Dec 29 2013
exp(x) * e.g.f. for row n = e.g.f. for diagonal n. For example, for n = 3 we have exp(x)*(2 + 3*x + 3*x^2/2! + x^3/3!) = 2 + 5*x + 11*x^2/2! + 21*x^3/3! + 36*x^4/4! + .... The same property holds more generally for Riordan arrays of the form ( f(x), x/(1 - x) ). - Peter Bala, Dec 21 2014
From G. C. Greubel, Jul 27 2022: (Start)
T(n, n-1) = n, for n >= 1.
T(n, n-2) = A000217(n-1), for n >= 2.
T(n, n-3) = A050407(n+1), for n >= 3.
T(2*n, n) = A144904(n+1), for n >= 1. (End)

A144903 Square array A(n,k), n>=0, k>=0, read by antidiagonals, where column k is the expansion of x/((1-x-x^3)*(1-x)^(k-1)).

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 2, 1, 1, 0, 1, 3, 3, 2, 1, 0, 1, 4, 6, 5, 3, 1, 0, 1, 5, 10, 11, 8, 4, 2, 0, 1, 6, 15, 21, 19, 12, 6, 3, 0, 1, 7, 21, 36, 40, 31, 18, 9, 4, 0, 1, 8, 28, 57, 76, 71, 49, 27, 13, 6, 0, 1, 9, 36, 85, 133, 147, 120, 76, 40, 19, 9, 0, 1, 10, 45, 121, 218, 280, 267, 196, 116, 59, 28, 13
Offset: 0

Views

Author

Alois P. Heinz, Sep 24 2008

Keywords

Examples

			Square array (A(n,k)) begins:
  0, 0,  0,  0,  0,   0,   0 ... A000004;
  1, 1,  1,  1,  1,   1,   1 ... A000012;
  0, 1,  2,  3,  4,   5,   6 ... A001477;
  0, 1,  3,  6, 10,  15,  21 ... A000217;
  1, 2,  5, 11, 21,  36,  57 ... A050407;
  1, 3,  8, 19, 40,  76, 133 ... ;
  1, 4, 12, 31, 71, 147, 200 ... A027658;
Antidiagonal triangle (T(n,k)) begins as:
  0;
  0,  1;
  0,  1,  0;
  0,  1,  1,  0;
  0,  1,  2,  1,  1;
  0,  1,  3,  3,  2,  1;
  0,  1,  4,  6,  5,  3,  1;
  0,  1,  5, 10, 11,  8,  4,  2;
  0,  1,  6, 15, 21, 19, 12,  6,  3;
		

Crossrefs

Rows 0-4, 6 give: A000004, A000012, A001477, A000217, A050407(n+3), A027658.
Columns 0-9 give: A078012 and A135851(n+2), A078012(n+2) and A135851(n+4), A077868(n-1) for n>0, A050228(n-1) for n>0, A226405, A144898, A144899, A144900, A144901, A144902.
Main diagonal gives: A144904.
Cf. A000930.

Programs

  • Magma
    A000930:= func< n | (&+[Binomial(n-2*j,j): j in [0..Floor(n/3)]]) >;
    A144903:= func< n,k | k eq 0 select 0 else (&+[Binomial(n-k+j-2,j)*A000930(k-j-1) : j in [0..k-1]]) >;
    [A144903(n,k): k in [0..n], n in [0..15]]; // G. C. Greubel, Aug 01 2022
    
  • Maple
    A:= proc(n,k) coeftayl (x/ (1-x-x^3)/ (1-x)^(k-1), x=0, n) end:
    seq(seq(A(n, d-n), n=0..d), d=0..13);
  • Mathematica
    (* First program *)
    a[n_, k_] := SeriesCoefficient[x/((1-x-x^3)*(1-x)^(k-1)), {x, 0, n}];
    Table[a[n-k, k], {n,0,12}, {k,n,0,-1}]//Flatten (* Jean-François Alcover, Jan 15 2014 *)
    (* Second Program *)
    A000930[n_]:= A000930[n]= Sum[Binomial[n-2*j,j], {j,0,Floor[n/3]}];
    T[n_, k_]:= T[n, k]= If[k==0, 0, Sum[Binomial[n-k+j-2,j]*A000930[k-j-1], {j,0,k- 1}]];
    Table[T[n, k], {n,0,15}, {k,0,n}]//Flatten (* G. C. Greubel, Aug 01 2022 *)
  • SageMath
    def A000930(n): return sum(binomial(n-2*j,j) for j in (0..(n//3)))
    def A144903(n,k):
        if (k==0): return 0
        else: return sum(binomial(n-k+j-2,j)*A000930(k-j-1) for j in (0..k-1))
    flatten([[A144903(n,k) for k in (0..n)] for n in (0..15)]) # G. C. Greubel, Aug 01 2022

Formula

G.f. of column k: x/((1-x-x^3)*(1-x)^(k-1)).
A(n, n) = A144904(n).
From G. C. Greubel, Aug 01 2022: (Start)
A(n, k) = Sum_{j=0..n-1} binomial(k+j-2, j)*A000930(n-j-1), with A(0, k) = 0.
T(n, k) = Sum_{j=0..k-1} binomial(n-k-j-2, j)*A000930(k-j-1), with T(n, 0) = 0.
T(2*n, n) = A144904(n). (End)

A050228 a(n) is the number of subsequences {s(k)} of {1,2,3,...n} such that s(k+1)-s(k) is 1 or 3.

Original entry on oeis.org

1, 3, 6, 11, 19, 31, 49, 76, 116, 175, 262, 390, 578, 854, 1259, 1853, 2724, 4001, 5873, 8617, 12639, 18534, 27174, 39837, 58396, 85596, 125460, 183884, 269509, 394999, 578914, 848455, 1243487, 1822435, 2670925, 3914448, 5736920, 8407883
Offset: 1

Views

Author

John W. Layman, Dec 20 1999

Keywords

Comments

The second differences c(n) of {a(n)} satisfy c(n)=c(n-1)+c(n-3) and give A000930 with the first 5 terms deleted.
Partial sums of A077868. - Paul Barry, Sep 16 2004

References

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

Crossrefs

Programs

  • Magma
    A050228:= func< n | n eq 0 select 0 else (&+[Binomial(n-2*j+1, j+2): j in [0..Floor((n+1)/3)]]) >;
    [A050228(n): n in [1..40]]; // G. C. Greubel, Jul 27 2022
    
  • Maple
    with(combstruct): SubSetSeqU := [T, {T=Subst(U,U), S=Set(U, card>=3), U=Sequence(Z, card>=3)}, unlabeled]: seq(count(SubSetSeqU, size=n), n=9..46); # Zerinvary Lajos, Mar 18 2008
  • Mathematica
    Rest[CoefficientList[Series[1/((1-x)^2*(1-x-x^3)), {x, 0, 50}], x]] (* G. C. Greubel, Apr 27 2017 *)
    LinearRecurrence[{3,-3,2,-2,1},{1,3,6,11,19},50] (* Harvey P. Dale, Apr 21 2020 *)
  • PARI
    my(x='x+O('x^50)); Vec(x/((1-x)^3-x^3*(1-x)^2)) \\ G. C. Greubel, Apr 27 2017
    
  • SageMath
    def A050228(n): return sum(binomial(n-2*j+1, j+2) for j in (0..((n+1)//3)))
    [A050228(n) for n in (1..40)] # G. C. Greubel, Jul 27 2022

Formula

From Paul Barry, Sep 16 2004: (Start)
G.f.: x/((1-x)^3 - x^3(1-x)^2).
a(n) = 3*a(n-1) - 3*a(n-2) + 2*a(n-3) - 2*a(n-4) + a(n-5).
a(n-1) = Sum_{k=0..floor(n/3)} binomial(n-2*k, k+2). (End)
G.f. = 1/((1-x)^2*(1-x-x^3)). - N. J. A. Sloane, Jun 02 2021
a(n) = A000930(n+5) - n - 4. - Greg Dresden, Jun 20 2021
From G. C. Greubel, Jul 27 2022: (Start)
a(n) = Sum_{j=0..floor((n+1)/3)} binomial(n-2*j+1, j+2).
a(n) = A099567(n+1, 2). (End)

A098578 a(n) = Sum_{k=0..floor(n/4)} C(n-3*k,k+1).

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 9, 13, 18, 25, 35, 49, 68, 94, 130, 180, 249, 344, 475, 656, 906, 1251, 1727, 2384, 3291, 4543, 6271, 8656, 11948, 16492, 22764, 31421, 43370, 59863, 82628, 114050, 157421, 217285, 299914, 413965, 571387, 788673, 1088588, 1502554
Offset: 0

Views

Author

Paul Barry, Sep 16 2004

Keywords

Comments

Partial sums of A003269 (with leading zero).

Crossrefs

Cf. A077868.

Programs

  • Magma
    I:=[0,1,2,3,4]; [n le 5 select I[n] else 2*Self(n-1) - Self(n-2) + Self(n-4) - Self(n-5): n in [1..30]]; // G. C. Greubel, Feb 03 2018
  • Mathematica
    CoefficientList[Series[x/((1-x)^2-x^4*(1-x)), {x,0,50}], x] (* or *) LinearRecurrence[{2,-1,0,1,-1}, {0,1,2,3,4}, 50] (* G. C. Greubel, Feb 03 2018 *)
  • PARI
    x='x+O('x^30); concat([0], Vec(x/((1-x)^2-x^4*(1-x)))) \\ G. C. Greubel, Feb 03 2018
    

Formula

G.f.: x/((1-x)^2-x^4(1-x)) = x / ((x-1)*(x^4+x-1)).
a(n) = 2*a(n-1) - a(n-2) + a(n-4) - a(n-5).
a(n) = a(n-1) + a(n-4) + 1.

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

Original entry on oeis.org

0, 1, 5, 15, 36, 76, 147, 267, 463, 775, 1262, 2011, 3150, 4867, 7438, 11268, 16951, 25358, 37766, 56047, 82945, 122482, 180553, 265798, 390880, 574358, 843432, 1237966, 1816384, 2664311, 3907237, 5729077, 8399372, 12313154, 18049371, 26456513, 38778103
Offset: 0

Views

Author

Alois P. Heinz, Sep 24 2008

Keywords

Crossrefs

Programs

  • Magma
    A144898:= func< n | n eq 0 select 0 else (&+[Binomial(n-2*j+3, j+4): j in [0..Floor((n+3)/3)]]) >;
    [A144898(n): n in [0..40]]; // G. C. Greubel, Jul 27 2022
    
  • Maple
    a:= n-> (Matrix(7, (i, j)-> if i=j-1 then 1 elif j=1 then [5, -10, 11, -9, 7, -4, 1][i] else 0 fi)^n)[1, 2]: seq(a(n), n=0..40);
  • Mathematica
    CoefficientList[Series[ x/((1-x-x^3)(1-x)^4), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 06 2013 *)
  • SageMath
    def A144898(n): return sum(binomial(n-2*j+3, j+4) for j in (0..((n+3)//3)))
    [A144898(n) for n in (0..40)] # G. C. Greubel, Jul 27 2022

Formula

G.f.: x/((1-x-x^3)*(1-x)^4).
From G. C. Greubel, Jul 27 2022: (Start)
a(n) = Sum_{j=0..floor((n+3)/3)} binomial(n-2*j+3, j+4).
a(n) = A099567(n+3, 4). (End)

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

Original entry on oeis.org

0, 1, 6, 21, 57, 133, 280, 547, 1010, 1785, 3047, 5058, 8208, 13075, 20513, 31781, 48732, 74090, 111856, 167903, 250848, 373330, 553883, 819681, 1210561, 1784919, 2628351, 3866317, 5682701, 8347012, 12254249, 17983326, 26382698, 38695852, 56745223, 83201736
Offset: 0

Views

Author

Alois P. Heinz, Sep 24 2008

Keywords

Crossrefs

Programs

  • Magma
    A144899:= func< n | n eq 0 select 0 else (&+[Binomial(n-2*j+4, j+5): j in [0..Floor((n+4)/3)]]) >;
    [A144899(n): n in [0..40]]; // G. C. Greubel, Jul 27 2022
    
  • Maple
    a:= n-> (Matrix(8, (i, j)-> if i=j-1 then 1 elif j=1 then [6, -15, 21, -20, 16, -11, 5, -1][i] else 0 fi)^n)[1, 2]: seq(a(n), n=0..40);
  • Mathematica
    CoefficientList[Series[x/((1-x-x^3)(1-x)^5), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 06 2013 *)
  • SageMath
    def A144899(n): return sum(binomial(n-2*j+4, j+5) for j in (0..((n+4)//3)))
    [A144899(n) for n in (0..40)] # G. C. Greubel, Jul 27 2022

Formula

G.f.: x/((1-x-x^3)*(1-x)^5).
From G. C. Greubel, Jul 27 2022: (Start)
a(n) = Sum_{j=0..floor((n+4)/3)} binomial(n-2*j+4, j+5).
a(n) = A099567(n+4, 5). (End)

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

Original entry on oeis.org

0, 1, 4, 10, 21, 40, 71, 120, 196, 312, 487, 749, 1139, 1717, 2571, 3830, 5683, 8407, 12408, 18281, 26898, 39537, 58071, 85245, 125082, 183478, 269074, 394534, 578418, 847927, 1242926, 1821840, 2670295, 3913782, 5736217, 8407142, 12321590, 18058510, 26466393
Offset: 0

Views

Author

Alois P. Heinz, Jun 06 2013

Keywords

Comments

From Bruno Berselli, Jun 07 2013: (Start)
A050228(n) = a(n) -a(n-1), n>0.
A077868(n-1)= a(n) -2*a(n-1) +a(n-2), n>1.
A000217(n) = a(n) -a(n-1) -a(n-3), n>2.
A000930(n-1)= a(n) -3*a(n-1) +3*a(n-2) -a(n-3), n>2.
n = a(n) -2*a(n-1) +a(n-2) -a(n-3) +a(n-4), n>3.
1 = a(n) -3*a(n-1) +3*a(n-2) -2*a(n-3) +2*a(n-4) -a(n-5), n>4.
0 = a(n) -4*a(n-1) +6*a(n-2) -5*a(n-3) +4*a(n-4) -3*a(n-5) +a(n-6), n>5.
(End)

Crossrefs

Programs

  • Magma
    A226405:= func< n | n eq 0 select 0 else (&+[Binomial(n-2*j+2, j+3): j in [0..Floor((n+2)/3)]]) >;
    [A226405(n): n in [0..40]]; // G. C. Greubel, Jul 27 2022
    
  • Maple
    a:= n-> (Matrix(6, (i, j)-> if i=j-1 then 1 elif j=1 then [4, -6, 5, -4, 3, -1][i] else 0 fi)^n)[1, 2]: seq(a(n), n=0..40);
  • Mathematica
    LinearRecurrence[{4,-6,5,-4,3,-1}, {0,1,4,10,21,40}, 40]  (* Bruno Berselli, Jun 07 2013 *)
    CoefficientList[Series[x/((1-x-x^3)*(1-x)^3), {x, 0, 50}], x] (* G. C. Greubel, Apr 28 2017 *)
  • PARI
    my(x='x+O('x^50)); Vec(x/((1-x-x^3)*(1-x)^3)) \\ G. C. Greubel, Apr 28 2017
    
  • SageMath
    def A226405(n): return sum(binomial(n-2*j+2, j+3) for j in (0..((n+2)//3)))
    [A226405(n) for n in (0..40)] # G. C. Greubel, Jul 27 2022

Formula

G.f.: x/((1-x-x^3)*(1-x)^3).
From G. C. Greubel, Jul 27 2022: (Start)
a(n) = Sum_{j=0..floor((n+2)/3)} binomial(n-2*j+2, j+3).
a(n) = A099567(n+2, 3). (End)

A077941 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

Comments

With three leading zeros, is the inverse binomial transform of A077868, with three leading zeros. - Paul Barry, Oct 22 2004

Crossrefs

Cf. A077990.

Programs

Formula

a(n) = sum{k=0..n+3, C(n+3, k)(-1)^(n+3-k)*sum{j=0..floor((k-2)/2), C(k-2-2j, j+1)}}. - Paul Barry, Oct 22 2004
a(n) = sum{k=0..floor(n/3), C(n+1-k,n-3k)*(-1)^k}. - Tani Akinari, Oct 10 2014
Showing 1-10 of 12 results. Next