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

A008859 a(n) = Sum_{k=0..6} binomial(n,k).

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 127, 247, 466, 848, 1486, 2510, 4096, 6476, 9949, 14893, 21778, 31180, 43796, 60460, 82160, 110056, 145499, 190051, 245506, 313912, 397594, 499178, 621616, 768212, 942649, 1149017, 1391842, 1676116, 2007328
Offset: 0

Views

Author

Keywords

Comments

a(n) is the maximal number of regions in 6-space formed by n-1 5-dimensional hypercubes. - Christian Schroeder, Jan 04 2016
a(n) is the number of binary words of length n matching the regular expression 0*1*0*1*0*1*0*. A000124, A000125, A000127, A006261 count binary words of the form 0*1*0*, 1*0*1*0*, 0*1*0*1*0*, and 1*0*1*0*1*0*, respectively. - Manfred Scheucher, Jun 22 2023

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 72, Problem 2.

Crossrefs

Programs

  • GAP
    List([0..40], n-> Sum([0..6], k-> Binomial(n,k)) ); # G. C. Greubel, Sep 13 2019
  • Haskell
    a008859 = sum . take 7 . a007318_row  -- Reinhard Zumkeller, Nov 24 2012
    
  • Magma
    [(&+[Binomial(n,k): k in [0..6]]): n in [0..40]]; // G. C. Greubel, Sep 13 2019
    
  • Maple
    A008859 := proc(n)
        add(binomial(n,k),k=0..6) ;
    end proc: # R. J. Mathar, Oct 30 2015
  • Mathematica
    Table[Sum[Binomial[n,k],{k,0,6}],{n,0,40}] (* Harvey P. Dale, Jan 16 2012 *)
  • PARI
    a(n)=sum(k=0,6,binomial(n,k)) \\ Charles R Greathouse IV, Sep 24 2015
    
  • Sage
    [sum(binomial(n,k) for k in (0..6)) for n in (0..40)] # G. C. Greubel, Sep 13 2019
    

Formula

a(n) = Sum_{k=0..3} binomial(n+1, 2*k). - Len Smiley, Oct 20 2001
O.g.f.: (1 - 5*x + 11*x^2 - 13*x^3 + 9*x^4 - 3*x^5 + x^6)/(1-x)^7. - R. J. Mathar, Apr 02 2008
a(n) = a(n-1) + A006261(n-1). - Christian Schroeder, Jan 04 2016
a(n) = (n^6 - 9*n^5 + 55*n^4 - 75*n^3 + 304*n^2 + 444*n + 720)/720. - Gerry Martens , May 04 2016
E.g.f.: (720 + 720*x + 360*x^2 + 120*x^3 + 30*x^4 + 6*x^5 + x^6)*exp(x)/6!. - Ilya Gutkovskiy, May 04 2016

A161702 a(n) = (-n^3 + 9n^2 - 5n + 3)/3.

Original entry on oeis.org

1, 2, 7, 14, 21, 26, 27, 22, 9, -14, -49, -98, -163, -246, -349, -474, -623, -798, -1001, -1234, -1499, -1798, -2133, -2506, -2919, -3374, -3873, -4418, -5011, -5654, -6349, -7098, -7903, -8766, -9689, -10674, -11723, -12838, -14021, -15274
Offset: 0

Views

Author

Reinhard Zumkeller, Jun 17 2009

Keywords

Comments

{a(k): 0 <= k < 4} = divisors of 14:
a(n) = A027750(A006218(13) + k + 1), 0 <= k < A000005(14).

Examples

			Differences of divisors of 14 to compute the coefficients of their interpolating polynomial, see formula:
  1     2     7    14
     1     5     7
        4     2
          -2
		

Crossrefs

Programs

Formula

a(n) = C(n,0) + C(n,1) + 4*C(n,2) - 2*C(n,3).
G.f.: (1-2*x+5*x^2-6*x^3)/(1-x)^4. - Colin Barker, Jan 08 2012
a(0)=1, a(1)=2, a(2)=7, a(3)=14, a(n)=4*a(n-1)-6*a(n-2)+4*a(n-3)-a(n-4). - Harvey P. Dale, Jun 15 2013

A161703 a(n) = (4*n^3 - 12*n^2 + 14*n + 3)/3.

Original entry on oeis.org

1, 3, 5, 15, 41, 91, 173, 295, 465, 691, 981, 1343, 1785, 2315, 2941, 3671, 4513, 5475, 6565, 7791, 9161, 10683, 12365, 14215, 16241, 18451, 20853, 23455, 26265, 29291, 32541, 36023, 39745, 43715, 47941, 52431, 57193, 62235, 67565, 73191, 79121
Offset: 0

Views

Author

Reinhard Zumkeller, Jun 17 2009

Keywords

Comments

{a(k): 0 <= k < 4} = divisors of 15:
a(n) = A027750(A006218(14) + k + 1), 0 <= k < A000005(15).

Examples

			Differences of divisors of 15 to compute the coefficients of their interpolating polynomial, see formula:
  1     3     5    15
     2     2    10
        0     8
           8
		

Crossrefs

Programs

Formula

a(n) = C(n,0) + 2*C(n,1) + 8*C(n,3).
G.f.: (1-x-x^2+9*x^3)/(1-x)^4. - Colin Barker, Jan 08 2012

A161711 a(n) = (-4*n^3 + 27*n^2 - 20*n + 3)/3.

Original entry on oeis.org

1, 2, 13, 26, 33, 26, -3, -62, -159, -302, -499, -758, -1087, -1494, -1987, -2574, -3263, -4062, -4979, -6022, -7199, -8518, -9987, -11614, -13407, -15374, -17523, -19862, -22399, -25142, -28099, -31278, -34687, -38334, -42227, -46374, -50783
Offset: 0

Views

Author

Reinhard Zumkeller, Jun 17 2009

Keywords

Comments

{a(k): 0 <= k < 4} = divisors of 26:
a(n) = A027750(A006218(25) + k + 1), 0 <= k < A000005(26).

Examples

			Differences of divisors of 26 to compute the coefficients of their interpolating polynomial, see formula:
  1     2    13    26
     1    11    13
       10     2
          -8
		

Crossrefs

Programs

  • Magma
    [(-4*n^3 + 27*n^2 - 20*n + 3)/3: n in [0..40]]; // Vincenzo Librandi, Jul 17 2011
    
  • Mathematica
    LinearRecurrence[{4,-6,4,-1},{1,2,13,26},40] (* Harvey P. Dale, Jul 02 2017 *)
  • PARI
    x='x+O('x^50); Vec((1-2*x+11*x^2-18*x^3)/(1-x)^4) \\ G. C. Greubel, Jul 16 2017

Formula

a(n) = C(n,0) + C(n,1) + 10*C(n,2) - 8*C(n,3).
G.f.: (1-2*x+11*x^2-18*x^3)/(1-x)^4. - Bruno Berselli, Jul 17 2011

A055795 a(n) = binomial(n,4) + binomial(n,2).

Original entry on oeis.org

0, 1, 3, 7, 15, 30, 56, 98, 162, 255, 385, 561, 793, 1092, 1470, 1940, 2516, 3213, 4047, 5035, 6195, 7546, 9108, 10902, 12950, 15275, 17901, 20853, 24157, 27840, 31930, 36456, 41448, 46937, 52955, 59535, 66711, 74518, 82992, 92170, 102090, 112791, 124313, 136697
Offset: 1

Views

Author

Clark Kimberling, May 28 2000

Keywords

Comments

Answer to the question: if you have a tall building and 4 plates and you need to find the highest story from which a plate thrown does not break, what is the number of stories you can handle given n tries?
If Y is a 2-subset of an n-set X then, for n >= 4, a(n-3) is the number of 4-subsets of X which do not have exactly one element in common with Y. - Milan Janjic, Dec 28 2007
Antidiagonal sums of A139600. - Johannes W. Meijer, Apr 29 2011
Also the number of maximal cliques in the n-tetrahedral graph for n > 5. - Eric W. Weisstein, Jun 12 2017
Mark each point on an 8^(n-2) grid with the number of points that are visible from the point; for n > 3, a(n) is the number of distinct values in the grid. - Torlach Rush, Mar 25 2021
Antidiagonal sums of both A057145 and also A134394 yield this sequence without the initial term 0. - Michael Somos, Nov 23 2021

Crossrefs

T(2n+1, n), array T as in A055794. Cf. A004006, A000127.

Programs

Formula

a(n) = A000127(n)-1. Differences give A000127.
a(1) = 1; a(n) = a(n-1) + 1 + A004006(n-1).
a(n+1) = C(n, 1) + C(n, 2) + C(n, 3) + C(n, 4). - James Sellers, Mar 16 2002
Row sums of triangle A134394. Also, binomial transform of [1, 2, 2, 2, 1, 0, 0, 0, ...]. - Gary W. Adamson, Oct 23 2007
O.g.f.: -x^2(1-2x+2x^2)/(x-1)^5. a(n) = A000332(n) + A000217(n-1). - R. J. Mathar, Apr 13 2008
a(n) = n*(n^3 - 6*n^2 + 23*n - 18)/24. - Gary Detlefs, Dec 08 2011
a(n) = 5*a(n-1) - 10*a(n-2) + 10*a(n-3) - 5*a(n-4) + a(n-5); a(1)=0, a(2)=1, a(3)=3, a(4)=7, a(5)=15. - Harvey P. Dale, Dec 07 2015

Extensions

Better description from Leonid Broukhis, Oct 24 2000
Edited by Zerinvary Lajos, Jul 24 2006
Offset corrected and Sellers formula adjusted by Gary Detlefs, Nov 28 2011

A008860 a(n) = Sum_{k=0..7} binomial(n,k).

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 128, 255, 502, 968, 1816, 3302, 5812, 9908, 16384, 26333, 41226, 63004, 94184, 137980, 198440, 280600, 390656, 536155, 726206, 971712, 1285624, 1683218, 2182396, 2804012, 3572224, 4514873, 5663890, 7055732
Offset: 0

Views

Author

Keywords

Comments

This is a general comment about sequences: A000012, A000027, A000124, A000125, A000127, A006261, A008859, this sequence, A008861, A008862, A008863. Let j in {1, 2, ..., 11} index these 11 sequences respective to their order above. Then a(n) in each sequence is the number of compositions of (n+1) into j or fewer parts. From this we see that the ordinary generating function for each sequence is Sum_{i=0..j-1} x^i/(1-x)^(i+1). - Geoffrey Critzer, Jan 19 2009
a(n) is the maximal number of regions in 7-space formed by n-1 6-dimensional hypercubes. Also the number of binary words of length n matching the regular expression 1*0*1*0*1*0*1*0*. A000124, A000125, A000127, A006261, A008859 count binary words of the form 0*1*0*, 1*0*1*0*, 0*1*0*1*0*, 1*0*1*0*1*0*, and 0*1*0*1*0*1*0* respectively. - Manfred Scheucher, Jun 22 2023

Examples

			a(8)=255 because there are 255 compositions of 9 into eight or fewer parts. - _Geoffrey Critzer_, Jan 23 2009
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 72, Problem 2.

Crossrefs

Programs

  • GAP
    List([0..40], n-> Sum([0..7], k-> Binomial(n,k)) ); # G. C. Greubel, Sep 13 2019
  • Haskell
    a008860 = sum . take 8 . a007318_row  -- Reinhard Zumkeller, Nov 24 2012
    
  • Magma
    [&+[Binomial(n, k): k in [0..7]]: n in [0..55]]; // Vincenzo Librandi, May 20 2019
    
  • Maple
    seq(sum(binomial(n,j), j=0..7), n=0..40); # G. C. Greubel, Sep 13 2019
  • Mathematica
    CoefficientList[Series[(1-6x+16x^2-24x^3+22x^4-12x^5+4x^6)/(1-x)^8, {x, 0, 34}], x] (* Georg Fischer, May 19 2019 *)
    Sum[Binomial[Range[41]-1, j-1], {j,8}] (* G. C. Greubel, Sep 13 2019 *)
  • PARI
    a(n)=(n+1)*(n^6-15*n^5+127*n^4-477*n^3+1576*n^2-1212*n+5040)/5040 \\ Charles R Greathouse IV, Dec 07 2011
    
  • Sage
    [binomial(n,1)+binomial(n,3)+binomial(n,5)+binomial(n,7) for n in range(1, 36)] # Zerinvary Lajos, May 17 2009
    
  • Sage
    [sum(binomial(n,k) for k in (0..7)) for n in (0..40)] # G. C. Greubel, Sep 13 2019
    

Formula

a(n) = Sum_{k=1..4} binomial(n+1, 2k-1) = (n^6 - 14*n^5 + 112*n^4 - 350*n^3 + 1099*n^2 + 364*n + 3828)*n/5040 + 1. [Len Smiley's formula for A006261, copied by Frank Ellermann]
G.f.: (1 - 6*x + 16*x^2 - 24*x^3 + 22*x^4 - 12*x^5 + 4*x^6)/(1-x)^8. - Geoffrey Critzer, Jan 19 2009 [Corrected by Georg Fischer, May 19 2019]

A008863 a(n) = Sum_{k=0..10} binomial(n,k).

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2047, 4083, 8100, 15914, 30827, 58651, 109294, 199140, 354522, 616666, 1048576, 1744436, 2842226, 4540386, 7119516, 10970272, 16628809, 24821333, 36519556, 53009102, 75973189, 107594213, 150676186, 208791332
Offset: 0

Views

Author

Keywords

Comments

a(n) is the number of compositions (ordered partitions) of n+1 into eleven or fewer parts. - Geoffrey Critzer, Jan 24 2009
a(n) is the maximal number of regions in 10-space formed by n-1 9-dimensional hypercubes. Also the number of binary words of length n matching the regular expression 0*1*0*1*0*1*0*1*0*1*0*. A000124, A000125, A000127, A006261, A008859, A008860, A008861, A008862 count binary words of the form 0*1*0*, 1*0*1*0*, 0*1*0*1*0*, 1*0*1*0*1*0*, 0*1*0*1*0*1*0*, 1*0*1*0*1*0*1*0*, 0*1*0*1*0*1*0*1*0* and 1*0*1*0*1*0*1*0*1*0* respectively. - Manfred Scheucher, Jun 23 2023

Examples

			a(11) = 2047 because there are 2^11=2048 compositions of 12 into any size parts but one of the compositions (1+1+...+1=12) has more than eleven parts. - _Geoffrey Critzer_, Jan 24 2009
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 72, Problem 2.

Crossrefs

Programs

  • GAP
    List([0..40], n-> Sum([0..10], k-> Binomial(n,k)) ); # G. C. Greubel, Sep 13 2019
  • Haskell
    a008863 = sum . take 11 . a007318_row  -- Reinhard Zumkeller, Nov 24 2012
    
  • Magma
    [(&+[Binomial(n,k): k in [0..10]]): n in [0..40]]; // G. C. Greubel, Sep 13 2019
    
  • Maple
    A008863:=n->add(binomial(n,k), k=0..10): seq(A008863(n), n=0..40); # Wesley Ivan Hurt, Apr 28 2017
  • Mathematica
    Table[Sum[Binomial[n, i], {i, 0, 10}], {n, 0, 40}] (* T. D. Noe, Mar 27 2012 *)
    LinearRecurrence[{11,-55,165,-330,462,-462,330,-165,55,-11,1},{1,2,4,8, 16,32,64,128,256,512,1024}, 40] (* Harvey P. Dale, Apr 25 2012 *)
  • PARI
    a(n)=sum(k=0,10,binomial(n,k)) \\ Charles R Greathouse IV, Apr 07 2016
    
  • Python
    A008863_list, m = [], [1, -8, 29, -62, 86, -80, 50, -20, 5, 0, 1]
    for _ in range(10**2):
        A008863_list.append(m[-1])
        for i in range(10):
            m[i+1] += m[i] # Chai Wah Wu, Jan 24 2016
    
  • Sage
    [sum(binomial(n,k) for k in (0..10)) for n in (0..40)] # G. C. Greubel, Sep 13 2019
    

Formula

a(n) = Sum_{k=0..5} binomial(n+1, 2k), compare A008859.
From Geoffrey Critzer, Jan 24 2009: (Start)
G.f.: (1 - 9*x + 37*x^2 - 91*x^3 + 148*x^4 - 166*x^5 + 130*x^6 - 70*x^7 + 25*x^8 - 5*x^9 + x^10)/(1-x)^11.
a(n) = (n^10 - 35*n^9 + 600*n^8 - 5790*n^7 + 36813*n^6 - 140595*n^5 + 408050*n^4 - 382060*n^3 + 1368936*n^2 + 2342880*n + 3628800)/10!. (End)
a(n) = 11*a(n-1) - 55*a(n-2) + 165*a(n-3) - 330*a(n-4) + 462*a(n-5) - 462*a(n-6) + 330*a(n-7) - 165*a(n-8) + 55*a(n-9) - 11*a(n-10) + a(n-11); a(0)=1, a(1)=2, a(2)=4, a(3)=8, a(4)=16, a(5)=32, a(6)=64, a(7)=128, a(8)=256, a(9)=512, a(10)=1024. - Harvey P. Dale, Apr 25 2012

A008861 a(n) = Sum_{k=0..8} binomial(n,k).

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 128, 256, 511, 1013, 1981, 3797, 7099, 12911, 22819, 39203, 65536, 106762, 169766, 263950, 401930, 600370, 880970, 1271626, 1807781, 2533987, 3505699, 4791323, 6474541, 8656937, 11460949, 15033173, 19548046
Offset: 0

Views

Author

Keywords

Comments

a(n) is the number of compositions (ordered partitions) of n+1 into nine or fewer parts. - Geoffrey Critzer, Jan 24 2009
a(n) is the maximal number of regions in 8-space formed by n-1 7-dimensional hypercubes. Also the number of binary words of length n matching the regular expression 0*1*0*1*0*1*0*1*0*. A000124, A000125, A000127, A006261, A008859, A008860 count binary words of the form 0*1*0*, 1*0*1*0*, 0*1*0*1*0*, 1*0*1*0*1*0*, 0*1*0*1*0*1*0*, and 1*0*1*0*1*0*1*0* respectively. - Manfred Scheucher, Jun 22 2023

Examples

			a(9)=511 because all but one (namely 1+1+1+...+1=10) of the 2^9 compositions of 10 are in nine or fewer parts. - _Geoffrey Critzer_, Jan 24 2009
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 72, Problem 2.

Crossrefs

Programs

  • GAP
    List([0..40], n-> Sum([0..8], k-> Binomial(n,k)) ); # G. C. Greubel, Sep 13 2019
  • Haskell
    a008861 = sum . take 9 . a007318_row -- Reinhard Zumkeller, Nov 24 2012
    
  • Magma
    [(&+[Binomial(n,k): k in [0..8]]): n in [0..40]]; // G. C. Greubel, Sep 13 2019
    
  • Maple
    seq(sum(binomial(n,j), j=0..8), n=0..40); # G. C. Greubel, Sep 13 2019
  • Mathematica
    Sum[Binomial[Range[41]-1, j-1], {j,9}] (* G. C. Greubel, Sep 13 2019 *)
  • PARI
    vector(40, n, sum(j=0,8, binomial(n-1,j))) \\ G. C. Greubel, Sep 13 2019
    
  • Sage
    [sum(binomial(n,k) for k in (0..8)) for n in (0..40)] # G. C. Greubel, Sep 13 2019
    

Formula

a(n) = Sum_{k=0..4} binomial(n+1, 2*k), compare A008859.
From Geoffrey Critzer, Jan 24 2009: (Start)
G.f.: (1 - 7*x + 22*x^2 - 40*x^3 + 46*x^4 - 34*x^5 + 16*x^6 - 4*x^7 + x^8)/(1-x)^9.
a(n) = (n^8 - 20*n^7 + 210*n^6 - 1064*n^5 + 3969*n^4 - 4340*n^3 + 15980*n^2 + 25584*n + 40320)/8!. (End)

A008862 a(n) = Sum_{k=0..9} binomial(n,k).

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1023, 2036, 4017, 7814, 14913, 27824, 50643, 89846, 155382, 262144, 431910, 695860, 1097790, 1698160, 2579130, 3850756, 5658537, 8192524, 11698223, 16489546, 22964087, 31621024, 43081973, 58115146, 77663192, 102875128
Offset: 0

Views

Author

Keywords

Comments

a(n) is the number of compositions (ordered partitions) of n+1 into ten or fewer parts. - Geoffrey Critzer, Jan 24 2009
a(n) is the maximal number of regions in 9-space formed by n-1 8-dimensional hypercubes. Also the number of binary words of length n matching the regular expression 1*0*1*0*1*0*1*0*1*0*. A000124, A000125, A000127, A006261, A008859, A008860, A008861 count binary words of the form 0*1*0*, 1*0*1*0*, 0*1*0*1*0*, 1*0*1*0*1*0*, 0*1*0*1*0*1*0*, 1*0*1*0*1*0*1*0* and 0*1*0*1*0*1*0*1*0* respectively. - Manfred Scheucher, Jun 23 2023

Examples

			a(10)=1023 because there are (2^10)-1 compositions of 11 into ten or fewer parts. - _Geoffrey Critzer_, Jan 24 2009
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 72, Problem 2.

Crossrefs

Programs

  • GAP
    List([0..40], n-> Sum([0..9], k-> Binomial(n,k)) ); # G. C. Greubel, Sep 13 2019
  • Haskell
    a008862 = sum . take 10 . a007318_row  -- Reinhard Zumkeller, Nov 24 2012
    
  • Magma
    [(&+[Binomial(n,k): k in [0..9]]): n in [0..40]]; // G. C. Greubel, Sep 13 2019
    
  • Maple
    seq(add(binomial(n,j), j=0..9), n=0..40); # G. C. Greubel, Sep 13 2019
  • Mathematica
    Table[Sum[Binomial[n,k],{k,0,9}],{n,0,40}] (* or *) LinearRecurrence[ {10,-45,120,-210,252,-210,120,-45,10,-1}, {1,2,4,8,16,32,64,128,256, 512}, 40] (* Harvey P. Dale, Mar 18 2012 *)
  • PARI
    vector(40, n, sum(j=0,9, binomial(n-1,j))) \\ G. C. Greubel, Sep 13 2019
    
  • Sage
    [sum(binomial(n,k) for k in (0..9)) for n in (0..40)] # G. C. Greubel, Sep 13 2019
    

Formula

a(n) = Sum_{k=1..5} binomial(n+1, 2*k-1), compare A008860.
From Geoffrey Critzer, Jan 24 2009: (Start)
G.f.: (1 - 8*x + 29*x^2 - 62*x^3 + 86*x^4 - 80*x^5 + 50*x^6 - 20*x^7 + 5*x^8)/(1-x)^10.
a(n) = (n^9 - 27*n^8 + 366*n^7 - 2646*n^6 + 12873*n^5 - 31563*n^4 + 79064*n^3 + 34236*n^2 + 270576*n + 362880)/9!. (End)
a(n) = 10*a(n-1) - 45*a(n-2) + 120*a(n-3) - 210*a(n-4) + 252*a(n-5) - 210*a(n-6) + 120*a(n-7) - 45*a(n-8) + 10*a(n-9) - a(n-10); a(0)=1, a(1)=2, a(2)=4, a(3)=8, a(4)=16, a(5)=32, a(6)=64, a(7)=128, a(8)=256, a(9)=512. - Harvey P. Dale, Mar 18 2012

A057960 Number of base-5 (n+1)-digit numbers starting with a zero and with adjacent digits differing by one or less.

Original entry on oeis.org

1, 2, 5, 13, 35, 95, 259, 707, 1931, 5275, 14411, 39371, 107563, 293867, 802859, 2193451, 5992619, 16372139, 44729515, 122203307, 333865643, 912137899, 2492007083, 6808289963, 18600594091, 50817768107, 138836724395, 379308985003, 1036291418795, 2831200807595
Offset: 0

Views

Author

Henry Bottomley, May 18 2001

Keywords

Comments

Or, number of three-choice paths along a corridor of width 5 and length n, starting from one side.
If b(n) is the number of three-choice paths along a corridor of width 5 and length n, starting from any of the five positions at the beginning of the corridor, then b(n) = a(n+2) for n >= 0. - Pontus von Brömssen, Sep 06 2021

Examples

			a(6) = 259 since a(5) = 21 + 30 + 25 + 14 + 5 so a(6) = (21+30) + (21 + 30 + 25) + (30+25+14) + (25+14+5) + (14+5) = 51 + 76 + 69 + 44 + 19.
		

Crossrefs

The "three-choice" comes in the recurrence b(n+1, i) = b(n, i-1) + b(n, i) + b(n, i+1) if 1 <= i <= 5. Narrower corridors produce A000012, A000079, A000129, A001519. An infinitely wide corridor (i.e., just one wall) would produce A005773. Two-choice corridors are A000124, A000125, A000127.
Cf. A038754, A052948, A155020 (first differences), A188866.

Programs

  • Maple
    with(combstruct): ZL0:=S=Prod(Sequence(Prod(a, Sequence(b))), b): ZL1:=Prod(begin_blockP, Z, end_blockP): ZL2:=Prod(begin_blockLR, Z, Sequence(Prod(mu_length, Z), card>=1), end_blockLR): ZL3:=Prod(begin_blockRL, Sequence(Prod(mu_length, Z), card>=1), Z, end_blockRL):Q:=subs([a=Union(ZL1, ZL2, ZL3), b=ZL3], ZL0), begin_blockP=Epsilon, end_blockP=Epsilon, begin_blockLR=Epsilon, end_blockLR=Epsilon, begin_blockRL=Epsilon, end_blockRL=Epsilon, mu_length=Epsilon:temp15:=draw([S, {Q}, unlabelled], size=15):seq(count([S, {Q}, unlabelled], size=n+2), n=0..28); # Zerinvary Lajos, Mar 08 2008
  • Mathematica
    Join[{a=1,b=2},Table[c=(a+b)*2-1;a=b;b=c,{n,0,50}]] (* Vladimir Joseph Stephan Orlovsky, Nov 22 2010 *)
    CoefficientList[Series[(1-x-x^2)/((1-x)*(1-2*x-2*x^2)),{x,0,100}],x] (* Vincenzo Librandi, Aug 13 2012 *)
  • Python
    from functools import cache
    @cache
    def B(n, j):
        if not 0 <= j < 5:
            return 0
        if n == 0:
            return j == 0
        return B(n - 1, j - 1) + B(n - 1, j) + B(n - 1, j + 1)
    def A057960(n):
        return sum(B(n, j) for j in range(5))
    print([A057960(n) for n in range(30)]) # Pontus von Brömssen, Sep 06 2021

Formula

a(n) = Sum_{0 <= i <= 6} b(n, i) where b(n, 0) = b(n, 6) = 0, b(0, 1) = 1, b(0, n) = 0 if n <> 1 and b(n+1, i) = b(n, i-1) + b(n, i) + b(n, i+1) if 1 <= i <= 5.
a(n) = 3*a(n-1) - 2*a(n-3) = 2*A052948(n) - A052948(n-2).
a(n) = ceiling((1+sqrt(3))^(n+2)/12). - Mitch Harris, Apr 26 2006
a(n) = floor(a(n-1)*(a(n-1) + 1/2)/a(n-2)). - Franklin T. Adams-Watters and Max Alekseyev, Apr 25 2006
a(n) = floor(a(n-1)*(1+sqrt(3))). - Philippe Deléham, Jul 25 2003
From Paul Barry, Sep 16 2003: (Start)
G.f.: (1-x-x^2)/((1-x)*(1-2*x-2*x^2));
a(n) = 1/3 + (2+sqrt(3))*(1+sqrt(3))^n/6 + (2-sqrt(3))*(1-sqrt(3))^n/6.
Binomial transform of A038754 (with extra leading 1). (End)
More generally, it appears that a(base,n) = a(base-1,n) + 3^(n-1) for base >= n; a(base,n) = a(base-1,n) + 3^(n-1)-2 when base = n-1. - R. H. Hardin, Dec 26 2006
a(n) = A188866(4,n-1) for n >= 2. - Pontus von Brömssen, Sep 06 2021
a(n) = 2*a(n-1) + 2*a(n-2) - 1 for n >= 2, a(0) = 1, a(1) = 2. - Philippe Deléham, Mar 01 2024
E.g.f.: exp(x)*(1 + 2*cosh(sqrt(3)*x) + sqrt(3)*sinh(sqrt(3)*x))/3. - Stefano Spezia, Mar 02 2024

Extensions

This is the result of merging two identical entries submitted by Henry Bottomley and R. H. Hardin. - N. J. A. Sloane, Aug 14 2012
Name clarified by Pontus von Brömssen, Sep 06 2021
Previous Showing 21-30 of 48 results. Next