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

A008937 a(n) = Sum_{k=0..n} T(k) where T(n) are the tribonacci numbers A000073.

Original entry on oeis.org

0, 1, 2, 4, 8, 15, 28, 52, 96, 177, 326, 600, 1104, 2031, 3736, 6872, 12640, 23249, 42762, 78652, 144664, 266079, 489396, 900140, 1655616, 3045153, 5600910, 10301680, 18947744, 34850335, 64099760, 117897840, 216847936, 398845537, 733591314, 1349284788
Offset: 0

Views

Author

N. J. A. Sloane, Alejandro Teruel (teruel(AT)usb.ve)

Keywords

Comments

a(n+1) is the number of n-bit sequences that avoid 1100. - David Callan, Jul 19 2004 [corrected by Kent E. Morrison, Jan 08 2019]. Also the number of n-bit sequences avoiding one of the patterns 1000, 0011, 1110, ... or any binary string of length 4 without overlap at beginning and end. Strings where it is not true are: 1111, 1010, 1001, ... and their bitwise complements. - Alois P. Heinz, Jan 09 2019
Row sums of Riordan array (1/(1-x), x(1+x+x^2)). - Paul Barry, Feb 16 2005
Diagonal sums of Riordan array (1/(1-x)^2, x(1+x)/(1-x)), A104698.
A shifted version of this sequence can be found in Eqs. (4) and (3) on p. 356 of Dunkel (1925) with r = 3. (Equation (3) follows equation (4) in the paper!) The whole paper is a study of the properties of this and other similar sequences indexed by the parameter r. For r = 2, we get a shifted version of A000071. For r = 4, we get a shifted version of A107066. For r = 5, we get a shifted version of A001949. For r = 6, we get a shifted version of A172316. See also the table in A172119. - Petros Hadjicostas, Jun 14 2019
Officially, to match A000073, this should start with a(0)=a(1)=0, a(2)=1. - N. J. A. Sloane, Sep 12 2020
Numbers with tribonacci representation that is a prefix of 100100100100... . - Jeffrey Shallit, Jul 10 2024

Examples

			G.f. = x + 2*x^2 + 4*x^3 + 8*x^4 + 15*x^5 + 28*x^6 + 52*x^7 + 96*x^8 + 177*x^9 + ... [edited by _Petros Hadjicostas_, Jun 12 2019]
		

References

  • A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, p. 41.

Crossrefs

Partial sums of A000073. Cf. A000213, A018921, A027084, A077908, A209972.
Row sums of A055216.
Column k = 1 of A140997 and second main diagonal of A140994.

Programs

  • GAP
    a:=[0,1,1];; for n in [4..40] do a[n]:=a[n-1]+a[n-2]+a[n-3]; od; a; # G. C. Greubel, Sep 13 2019
  • Haskell
    a008937 n = a008937_list !! n
    a008937_list = tail $ scanl1 (+) a000073_list
    -- Reinhard Zumkeller, Apr 07 2012
    
  • Magma
    [ n eq 1 select 0 else n eq 2 select 1 else n eq 3 select 2 else n eq 4 select 4 else 2*Self(n-1)-Self(n-4): n in [1..40] ]; // Vincenzo Librandi, Aug 21 2011
    
  • Maple
    A008937 := proc(n) option remember; if n <= 3 then 2^n else 2*procname(n-1)-procname(n-4) fi; end;
    a:= n-> (Matrix([[1,1,0,0], [1,0,1,0], [1,0,0,0], [1,0,0,1]])^n)[4,1]: seq(a(n), n=0..50); # Alois P. Heinz, Jul 24 2008
  • Mathematica
    CoefficientList[Series[x/(1-2x+x^4), {x, 0, 40}], x]
    Accumulate[LinearRecurrence[{1,1,1},{0,1,1},40]] (* Harvey P. Dale, Dec 04 2017 *)
    LinearRecurrence[{2, 0, 0, -1},{0, 1, 2, 4},40] (* Ray Chandler, Mar 01 2024 *)
  • PARI
    {a(n) = if( n<0, polcoeff( - x^3 / (1 - 2*x^3 + x^4) + x * O(x^-n), -n), polcoeff( x / (1 - 2*x + x^4) + x * O(x^n), n))}; /* Michael Somos, Aug 23 2014 */
    
  • PARI
    a(n) = sum(j=0, n\2, sum(k=0, j, binomial(n-2*j,k+1)*binomial(j,k)*2^k)); \\ Michel Marcus, Sep 08 2017
    
  • SageMath
    def A008937_list(prec):
        P = PowerSeriesRing(ZZ, 'x', prec)
        x = P.gen().O(prec)
        return (x/(1-2*x+x^4)).list()
    A008937_list(40) # G. C. Greubel, Sep 13 2019
    

Formula

a(n) = A018921(n-2) = A027084(n+1) + 1.
a(n) = (A000073(n+2) + A000073(n+4) - 1)/2.
From Mario Catalani (mario.catalani(AT)unito.it), Aug 09 2002: (Start)
G.f.: x/((1-x)*(1-x-x^2-x^3)).
a(n) = 2*a(n-1) - a(n-4), a(0) = 0, a(1) = 1, a(2) = 2, a(3) = 4. (End)
a(n) = 1 + a(n-1) + a(n-2) + a(n-3). E.g., a(11) = 1 + 600 + 326 + 177 = 1104. - Philippe LALLOUET (philip.lallouet(AT)orange.fr), Oct 29 2007
a(n) = term (4,1) in the 4 X 4 matrix [1,1,0,0; 1,0,1,0; 1,0,0,0; 1,0,0,1]^n. - Alois P. Heinz, Jul 24 2008
a(n) = -A077908(-n-3). - Alois P. Heinz, Jul 24 2008
a(n) = (A000213(n+2) - 1) / 2. - Reinhard Zumkeller, Apr 07 2012
a(n) = Sum_{j=0..floor(n/2)} Sum_{k=0..j} binomial(n-2j,k+1) *binomial(j,k)*2^k. - Tony Foster III, Sep 08 2017
a(n) = Sum_{k=0..floor(n/2)} (n-2*k)*hypergeom([-k,-n+2*k+1], [2], 2). - Peter Luschny, Nov 09 2017
a(n) = 2^(n-1)*hypergeom([1-n/4, 1/4-n/4, 3/4-n/4, 1/2-n/4], [1-n/3, 1/3-n/3, 2/3-n/3], 16/27) for n > 0. - Peter Luschny, Aug 20 2020
a(n-1) = T(n) + T(n-3) + T(n-6) + ... + T(2+((n-2) mod 3)), for n >= 4, where T is A000073(n+1). - Jeffrey Shallit, Dec 24 2020

A172119 Sum the k preceding elements in the same column and add 1 every time.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 2, 1, 1, 4, 4, 2, 1, 1, 5, 7, 4, 2, 1, 1, 6, 12, 8, 4, 2, 1, 1, 7, 20, 15, 8, 4, 2, 1, 1, 8, 33, 28, 16, 8, 4, 2, 1, 1, 9, 54, 52, 31, 16, 8, 4, 2, 1, 1, 10, 88, 96, 60, 32, 16, 8, 4, 2, 1, 1, 11, 143, 177, 116, 63, 32, 16, 8, 4, 2, 1, 1, 12, 232, 326, 224, 124, 64, 32, 16
Offset: 0

Views

Author

Mats Granvik, Jan 26 2010

Keywords

Comments

Columns are related to Fibonacci n-step numbers. Are there closed forms for the sequences in the columns?
We denote by a(n,k) the number which is in the (n+1)-th row and (k+1)-th-column. With help of the definition, we also have the recurrence relation: a(n+k+1, k) = 2*a(n+k, k) - a(n, k). We see on the main diagonal the numbers 1,2,4, 8, ..., which is clear from the formula for the general term d(n)=2^n. - Richard Choulet, Jan 31 2010
Most of the paper by Dunkel (1925) is a study of the columns of this table. - Petros Hadjicostas, Jun 14 2019

Examples

			Triangle begins:
n\k|....0....1....2....3....4....5....6....7....8....9...10
---|-------------------------------------------------------
0..|....1
1..|....1....1
2..|....1....2....1
3..|....1....3....2....1
4..|....1....4....4....2....1
5..|....1....5....7....4....2....1
6..|....1....6...12....8....4....2....1
7..|....1....7...20...15....8....4....2....1
8..|....1....8...33...28...16....8....4....2....1
9..|....1....9...54...52...31...16....8....4....2....1
10.|....1...10...88...96...60...32...16....8....4....2....1
		

Crossrefs

Cf. A000071 (col. 3), A008937 (col. 4), A107066 (col. 5), A001949 (col. 6), A172316 (col. 7), A172317 (col. 8), A172318 (col. 9), A172319 (col. 10), A172320 (col. 11), A144428.
Cf. (1-((-1)^T(n, k)))/2 = A051731, see formula by Hieronymus Fischer in A022003.

Programs

  • GAP
    T:= function(n,k)
        if k=0 and k=n then return 1;
        elif k<0 or k>n then return 0;
        else return 1 + Sum([1..k], j-> T(n-j,k));
        fi;
      end;
    Flat(List([0..12], n-> List([0..n], k-> T(n,k) ))); # G. C. Greubel, Jul 27 2019
  • Magma
    T:= func< n,k | (&+[(-1)^j*2^(n-k-(k+1)*j)*Binomial(n-k-k*j, n-k-(k+1)*j): j in [0..Floor((n-k)/(k+1))]]) >;
    [[T(n,k): k in [0..n]]: n in [0..12]]; // G. C. Greubel, Jul 27 2019
    
  • Maple
    for k from 0 to 20 do for n from 0 to 20 do b(n):=sum((-1)^j*binomial(n-k*j,n-(k+1)*j)*2^(n-(k+1)*j),j=0..floor(n/(k+1))):od: seq(b(n),n=0..20):od; # Richard Choulet, Jan 31 2010
    A172119 := proc(n,k)
        option remember;
        if k = 0 then
            1;
        elif k > n then
            0;
        else
            1+add(procname(n-k+i,k),i=0..k-1) ;
        end if;
    end proc:
    seq(seq(A172119(n,k),k=0..n),n=0..12) ; # R. J. Mathar, Sep 16 2017
  • Mathematica
    T[, 0] = 1; T[n, n_] = 1; T[n_, k_] /; k>n = 0; T[n_, k_] := T[n, k] = Sum[T[n-k+i, k], {i, 0, k-1}] + 1;
    Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten
    Table[Sum[(-1)^j*2^(n-k-(k+1)*j)*Binomial[n-k-k*j, n-k-(k+1)*j], {j, 0, Floor[(n-k)/(k+1)]}], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Jul 27 2019 *)
  • PARI
    T(n,k) = if(k<0 || k>n, 0, k==1 && k==n, 1, 1 + sum(j=1,k, T(n-j,k)));
    for(n=1,12, for(k=0,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Jul 27 2019
    
  • Sage
    @CachedFunction
    def T(n, k):
        if (k==0 and k==n): return 1
        elif (k<0 or k>n): return 0
        else: return 1 + sum(T(n-j, k) for j in (1..k))
    [[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Jul 27 2019
    

Formula

T(n,0) = 1.
T(n,1) = n.
T(n,2) = A000071(n+1).
T(n,3) = A008937(n-2).
The general term in the n-th row and k-th column is given by: a(n, k) = Sum_{j=0..floor(n/(k+1))} ((-1)^j binomial(n-k*j,n-(k+1)*j)*2^(n-(k+1)*j)). For example: a(5,3) = binomial(5,5)*2^5 - binomial(2,1)*2^1 = 28. The generating function of the (k+1)-th column satisfies: psi(k)(z)=1/(1-2*z+z^(k+1)) (for k=0 we have the known result psi(0)(z)=1/(1-z)). - Richard Choulet, Jan 31 2010 [By saying "(k+1)-th column" the author actually means "k-th column" for k = 0, 1, 2, ... - Petros Hadjicostas, Jul 26 2019]

A001949 Solutions of a fifth-order probability difference equation.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 2, 4, 8, 16, 32, 63, 124, 244, 480, 944, 1856, 3649, 7174, 14104, 27728, 54512, 107168, 210687, 414200, 814296, 1600864, 3147216, 6187264, 12163841, 23913482, 47012668, 92424472, 181701728, 357216192, 702268543, 1380623604, 2714234540
Offset: 0

Views

Author

Keywords

Comments

This sequence is the case r = 5 in the solution to an r-th order probability difference equation that can be found in Eqs. (4) and (3) on p. 356 of Dunkel (1925). (Equation (3) follows equation (4) in the paper!) For r = 2, we get a shifted version of A000071. For r = 3, we get a shifted version of A008937. For r = 4, we get a shifted version of A107066. For r = 6, we get a shifted version of A172316. See also the table in A172119. - Petros Hadjicostas, Jun 15 2019

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Column k = 1 of A141020 (with a different offset) and second main diagonal of A141021 (with no zeros).
Column k = 5 of A172119.
Partial sums of A001591.

Programs

  • Maple
    A001949:=1/(z-1)/(z**5+z**4+z**3+z**2+z-1); # Simon Plouffe in his 1992 dissertation
  • Mathematica
    t={0,0,0,0,0};Do[AppendTo[t,t[[-5]]+t[[-4]]+t[[-3]]+t[[-2]]+t[[-1]]+1],{n,40}];t (* Vladimir Joseph Stephan Orlovsky, Jan 21 2012 *)
    LinearRecurrence[{2,0,0,0,0,-1},{0,0,0,0,0,1},40] (* Harvey P. Dale, Jan 17 2015 *)
  • Maxima
    a(n):=sum(sum((-1)^j*binomial(n-5*j-5,k-1)*binomial(n-k-5*j-4,j),j,0,(n-k-4)/5),k,1,n-4); /* Vladimir Kruchinin, Oct 19 2011 */
    
  • PARI
    x='x+O('x^99); concat(vector(5), Vec(x^5/((x-1)*(x^5+x^4+x^3+x^2+x-1)))) \\ Altug Alkan, Oct 04 2017

Formula

For n >= 6, a(n+1) = 2*a(n) - a(n-5).
G.f.: x^5 / ( (x-1)*(x^5 + x^4 + x^3 + x^2 + x - 1) ).
a(n) = Sum_{k=1..n-4} Sum_{j=0..floor((n-k-4)/5)} (-1)^j*binomial(n-5*j-5, k-1)*binomial(n-k-5*j-4, j). - Vladimir Kruchinin, Oct 19 2011
4*a(n) = A000322(n+1) - 1. - R. J. Mathar, Aug 16 2017
From Petros Hadjicostas, Jun 15 2019: (Start)
a(n) = 1 + a(n-1) + a(n-2) + a(n-3) + a(n-4) + a(n-5) for n >= 5. (See Eq. (4) and the Theorem with r = 5 on p. 356 of Dunkel (1925).)
a(n) = T(n - 5, 5) for n >= 5, where T(n, k) = Sum_{j = 0..floor(n/(k+1))} (-1)^j * binomial(n - k*j, n - (k+1)*j) * 2^(n - (k+1)*j) for 0 <= k <= n. This is Richard Choulet's formula in A172119.
(End)

Extensions

Name edited by Petros Hadjicostas, Jun 15 2019

A172317 8th column of A172119.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 128, 255, 508, 1012, 2016, 4016, 8000, 15936, 31744, 63233, 125958, 250904, 499792, 995568, 1983136, 3950336, 7868928, 15674623, 31223288, 62195672, 123891552, 246787536, 491591936, 979233536
Offset: 0

Views

Author

Richard Choulet, Jan 31 2010

Keywords

Examples

			a(4) = binomial(4,4)*2^4 = 16.
a(9) = binomial(9,9)*2^9 - binomial(2,1)*2^1 = 512 - 4 = 508.
		

Crossrefs

Partial sums of A066178.

Programs

  • Maple
    k:=7:taylor(1/(1-2*z+z^(k+1)),z=0,30); for k from 0 to 20 do for n from 0 to 30 do b(n):=sum((-1)^j*binomial(n-k*j,n-(k+1)*j)*2^(n-(k+1)*j),j=0..floor(n/(k+1))):od:k: seq(b(n),n=0..30):od;

Formula

The generating function is f such that: f(z)=1/(1-2*z+z^8). Recurrence relation: a(n+8)=2*a(n+7)-a(n). General term: a(n) = Sum_{j=0..floor(n/(k+1))} ((-1)^j*binomial(n-k*j,n-(k+1)*j)*2^(n-(k+1)*j)) with k=7.

A172318 9th column of the array A172119.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 128, 256, 511, 1020, 2036, 4064, 8112, 16192, 32320, 64512, 128768, 257025, 513030, 1024024, 2043984, 4079856, 8143520, 16254720, 32444928, 64761088, 129265151, 258017272, 515010520, 1027977056
Offset: 0

Views

Author

Richard Choulet, Jan 31 2010

Keywords

Examples

			a(7)=C(7,7)*2^7=128. a(10)=C(10,10)*2^10-C(2,1)*2^1=1020.
		

Crossrefs

Partial sums of A079262.

Programs

  • Maple
    for k from 0 to 20 do for n from 0 to 30 do b(n):=sum((-1)^j*binomial(n-k*j,n-(k+1)*j)*2^(n-(k+1)*j),j=0..floor(n/(k+1))):od:k: seq(b(n),n=0..30):od; k:=8:taylor(1/(1-2*z+z^(k+1)),z=0,30);

Formula

G.f.: 1/(1-2*z+z^9).
a(n) = sum((-1)^j*binomial(n-k*j,n-(k+1)*j)*2^(n-(k+1)*j),j=0..floor(n/(k+1))) with k=8.
Recurrence relation: a(n+9) = 2*a(8) - a(n).

A172319 10th column of A172119.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1023, 2044, 4084, 8160, 16304, 32576, 65088, 130048, 259840, 519168, 1037313, 2072582, 4141080, 8274000, 16531696, 33030816, 65996544, 131863040, 263466240, 526413312, 1051789311
Offset: 0

Views

Author

Richard Choulet, Jan 31 2010

Keywords

Crossrefs

Partial sums of A104144.

Programs

  • Maple
    for k from 0 to 20 do for n from 0 to 30 do b(n):=sum((-1)^j*binomial(n-k*j,n-(k+1)*j)*2^(n-(k+1)*j),j=0..floor(n/(k+1))):od:k: seq(b(n),n=0..30):od;
  • Mathematica
    LinearRecurrence[{2,0,0,0,0,0,0,0,0,-1},{1,2,4,8,16,32,64,128,256,512},40] (* Harvey P. Dale, Sep 22 2020 *)

Formula

G.f.: 1/(1-2*z+z^10).
a(n)=sum((-1)^j*binomial(n-k*j,n-(k+1)*j)*2^(n-(k+1)*j),j=0..floor(n/(k+1))). a(n+10)=2*a(n+9)-a(n).

A172320 11th column of A172119.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2047, 4092, 8180, 16352, 32688, 65344, 130624, 261120, 521984, 1043456, 2085888, 4169729, 8335366, 16662552, 33308752, 66584816, 133104288, 266077952, 531894784, 1063267584
Offset: 0

Views

Author

Richard Choulet, Jan 31 2010

Keywords

Examples

			a(12)=C(12,12)*2^12-C(2,1)*2^1=4092.
		

Crossrefs

Programs

  • Maple
    k:=10:taylor(1/(1-2*z+z^(k+1)),z=0,30); for k from 0 to 20 do for n from 0 to 30 do b(n):=sum((-1)^j*binomial(n-k*j,n-(k+1)*j)*2^(n-(k+1)*j),j=0..floor(n/(k+1))):od:k: seq(b(n),n=0..30):od;

Formula

a(n)=sum((-1)^j*binomial(n-k*j,n-(k+1)*j)*2^(n-(k+1)*j),j=0..floor(n/(k+1))) with k=10.
G.f: f(z)=1/(1-2*z+z^(11)).
a(n+11)=2*a(n+10)-a(n).
Showing 1-7 of 7 results.