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.

A187430 Number of nonnegative walks of n steps with step sizes 1 and 2, starting and ending at 0.

Original entry on oeis.org

1, 0, 2, 2, 11, 24, 93, 272, 971, 3194, 11293, 39148, 139687, 497756, 1798002, 6517194, 23807731, 87336870, 322082967, 1192381270, 4431889344, 16527495396, 61831374003, 231973133544, 872598922407, 3290312724374, 12434632908623, 47089829065940, 178672856753641
Offset: 0

Views

Author

Keywords

Comments

Equivalently, the number of paths from (0,0) to (n,0) using steps of the form (1,2),(1,1),(1,-1) or (1,-2) and staying on or above the x-axis.
Self-convolution of A055113. - Paul D. Hanna, May 31 2015
Logarithmic derivative yields A092765 (with offset 1). - Paul D. Hanna, May 31 2015

Examples

			The 11 length-4 walks are 0,2,4,2,0; 0,2,3,2,0; 0,2,3,1,0; 0,2,1,2,0; 0,2,0,2,0; 0,2,0,1,0; 0,1,3,2,0; 0,1,3,1,0; 0,1,2,1,0; 0,1,0,2,0; and 0,1,0,1,0.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<3, (n-1)*(3*n-2)/2,
         ((n+1)*(115*n^3-137*n^2-10*n+8) *a(n-1)
          +4*(2*n-1)*(5*n^3+36*n^2-26*n-12) *a(n-2)
          -36*(n-2)*(2*n-1)*(2*n-3)*(5*n+1) *a(n-3))
          / (2*(5*n-4)*(2*n+1)*(n+2)*(n+1)))
        end:
    seq(a(n), n=0..30); # Alois P. Heinz, May 16 2013
  • Mathematica
    a[n_] := (Sum[Binomial[n+1, l]*Sum[Binomial[n-2*i-1, 2*l-1]*Binomial[n-l+1, i], {i, 0, (n-1)/2}], {l, 0, n+1}] + (((-1)^n+1)*Binomial[n+1, n/2])/2)/(n+1); Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Oct 24 2016, after Vladimir Kruchinin *)
  • Maxima
    a(n):=((sum(binomial(n+1,l)*sum(binomial(n-2*i-1,2*l-1)*binomial(n-l+1,i),i,0,(n-1)/2),l,0,n+1))+(((-1)^n+1)*binomial(n+1,n/2))/2)/(n+1); /* Vladimir Kruchinin, Jun 26 2015 */
  • PARI
    al(n)={local(r,p);
    r=vector(n);r[1]=p=1;
    for(k=2,n,p*=1+x+x^3+x^4;p=(p-polcoeff(p,0)-polcoeff(p,1)*x)/x^2;r[k]=polcoeff(p,0));
    r}
    

Formula

G.f.: 1/(2*x)-(1+(1-4*x)^(1/2))*((2+2*(1-4*x)^(1/2)+12*x)^(1/2)-2)/(8*x^2). - Mark van Hoeij, May 16 2013
a(n) ~ (3/sqrt(5)-1) * 2^(2*n+1) / (sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Sep 09 2014
G.f.: exp( Sum_{n>=1} A092765(n)*x^n/n ), where A092765(n) = Sum_{k=0..n} binomial(n,k)*binomial(n,2*n-3*k). - Paul D. Hanna, May 31 2015
a(n) = ((Sum_{l=0..n+1} (C(n+1,l)*Sum_{i=0..(n-1)/2}(C(n-2*i-1,2*l-1)*C(n-l+1,i))))+(((-1)^n+1)/2*C(n+1,n/2)))/(n+1). - Vladimir Kruchinin, Jun 26 2015
Sum_{n>=0} a(n)*x^(n+1) is the compositional inverse of x*(1-x^2)^2/(1+x^3)^2. - Ira M. Gessel, Sep 19 2017
Conjecture: 1 + Sum_{n>=0} a(n)*(-1)^n x^(n+1)/(1-x)^(2*n+2) = C(x), the g.f. for the Catalan numbers A000108. - Benedict W. J. Irwin, Jan 13 2017
D-finite with recurrence 2*(2*n+1)*(n+2)*(n+1)*a(n) +(n+1)*(n^2-27*n+2)*a(n-1) +2*(-73*n^3+204*n^2-167*n+6)*a(n-2) +12*(n-3)*(2*n-3)*(4*n-7)*a(n-3) +216*(2*n-5)*(n-3)*(2*n-3)*a(n-4)=0. - R. J. Mathar, Sep 29 2020
From Seiichi Manyama, Jan 17 2024: (Start)
G.f.: (1/x) * Series_Reversion( x * (1-x)^2 / (1-x+x^2)^2 ).
a(n) = (1/(n+1)) * Sum_{k=0..floor(n/2)} binomial(2*n+2,k) * binomial(n-k-1,n-2*k). (End)

A168595 a(n) = Sum_{k=0..2n} C(2n,k)*A027907(n,k) where A027907 is the triangle of trinomial coefficients.

Original entry on oeis.org

1, 4, 36, 358, 3748, 40404, 443886, 4941654, 55555236, 629285416, 7170731236, 82108083204, 943960439086, 10889085499348, 125974782200478, 1461030555025458, 16981658850393252, 197757344280343968
Offset: 0

Views

Author

Paul D. Hanna, Nov 30 2009

Keywords

Comments

Compare to A092765(n) = Sum_{k=0..2n} (-1)^k*C(2n,k)*A027907(n,k), which is the number of paths of length n ending at origin in 1-D random walk with jumps to next-nearest neighbors.

Crossrefs

Programs

  • Maple
    cb := n -> binomial(2*n, n);
    a := n -> add((-1)^(n-k)*binomial(n,k)*cb(n+k), k=0..n);
    seq(a(n), n=0..17); # Peter Luschny, Aug 15 2017
  • PARI
    {a(n)=sum(k=0,2*n,binomial(2*n,k)*polcoeff((1+x+x^2)^n,k))}

Formula

a(n) = 2*A132306(n) for n > 0. - Mark van Hoeij, Jul 02 2010
a(n) = Sum_{k=0..n} (-1)^(n-k)*binomial(n,k)*cb(n+k) with cb(n) = binomial(2n,n). - Peter Luschny, Aug 15 2017

A137725 Number of sequences of length n with elements {-2,-1,+1,+2}, such that the sum of elements of the whole sequence but of no proper subsequence equals 0 modulo n. For n>=4, the number of Hamiltonian (directed) circuits on the circulant graph C_n(1,2).

Original entry on oeis.org

4, 4, 16, 18, 24, 32, 46, 58, 82, 112, 158, 220, 316, 450, 650, 938, 1364, 1982, 2892, 4220, 6170, 9022, 13206, 19332, 28314, 41472, 60760, 89022, 130446, 191150, 280120, 410506, 601600, 881656, 1292102, 1893634, 2775226, 4067256, 5960822, 8735972, 12803156, 18763898, 27499794, 40302866, 59066684
Offset: 1

Views

Author

Max Alekseyev, Feb 08 2008

Keywords

Comments

Number of 1-D walks with jumps to next-nearest neighbors with n steps, starting at 0 and ending at -2n, -n, 0, n, or 2n, such that every point is visited at most once and every pair of points at the distance n contains at least one unvisited point (not counting the ending visit). Cf. A092765.
For n>1, the number of circular permutations (counted up to rotations) of {0, 1,...,n-1} such that the distance between every two adjacent elements is -2,-1,1,or 2 modulo n. Cf. A003274.

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[-2*x^2-2*x-6-1/(x+1)+2/(x-1)^2+1/(x-1)+(4*x-6)/(x^3+x-1), {x, 0, 50}], x] (* G. C. Greubel, Apr 28 2017 *)
  • PARI
    my(x='x+O('x^50)); Vec(-2*x^2-2*x-6-1/(x+1)+2/(x-1)^2+1/(x-1)+(4*x-6)/(x^3+x-1)) \\ G. C. Greubel, Apr 28 2017

Formula

For even n>=4, a(n) = 2*(n + 3*A000930(n) - 2*A000930(n-1)); for odd n>=3, a(n) = 2*(n + 1 + 3*A000930(n) - 2*A000930(n-1)).
For n>8, a(n) = 2*a(n-1) - a(n-3) - a(n-5) + a(n-6) or a(n) = a(n-1) + a(n-2) - a(n-5) - 4.
O.g.f.: -2*x^2-2*x-6-1/(x+1)+2/(x-1)^2+1/(x-1)+(4*x-6)/(x^3+x-1). - R. J. Mathar, Feb 10 2008

Extensions

Typo in formulas corrected by Max Alekseyev, Nov 03 2010

A166135 Number of possible paths to each node that lies along the edge of a cut 4-nomial tree, that is rooted one unit from the cut.

Original entry on oeis.org

1, 1, 3, 7, 22, 65, 213, 693, 2352, 8034, 28014, 98505, 350548, 1256827, 4542395, 16517631, 60417708, 222087320, 820099720, 3040555978, 11314532376, 42243332130, 158196980682, 594075563613, 2236627194858, 8440468925400, 31921622746680, 120970706601255
Offset: 1

Views

Author

Rick Jarosh (rick(AT)jarosh.net), Oct 08 2009

Keywords

Comments

This is the third member of an infinite series of infinite series, the first two being the Catalan and Motzkin integers. The Catalan numbers lie on the edge of cut 2-nomial trees, Motzkin integers on the edge of cut 3-nomial trees.
a(n) is the number of increasing unary-binary trees with associated permutation that avoids 213. For more information about increasing unary-binary trees with an associated permutation, see A245888. - Manda Riehl, Aug 07 2014
Number of positive walks with n steps {-2,-1,1,2} starting at the origin, ending at altitude 1, and staying strictly above the x-axis. - David Nguyen, Dec 16 2016

Crossrefs

A055113 is the third sequence from the top of the graph illustrated above.

Programs

  • Magma
    [(&+[Binomial(n,k)*Binomial(n,2*n-3*k-1): k in [0..n]])/n : n in [1..30]]; // G. C. Greubel, Dec 12 2019
    
  • Maple
    seq( add(binomial(n,k)*binomial(n,2*n-3*k-1), k=0..n)/n, n=1..30); # G. C. Greubel, Dec 12 2019
  • Mathematica
    Rest[CoefficientList[Series[(Sqrt[(2-2Sqrt[1-4x]-3x)/x]-1)/2, {x, 0, 30}],x]] (* Benedict W. J. Irwin, Sep 24 2016 *)
  • PARI
    vector(30, n, sum(k=0,n, binomial(n,k)*binomial(n,2*n-3*k-1))/n ) \\ G. C. Greubel, Dec 12 2019
    
  • Sage
    [sum(binomial(n,k)*binomial(n,2*n-3*k-1) for k in (0..n))/n for n in (1..30)] # G. C. Greubel, Dec 12 2019

Formula

a(n) = ((36*n+18)*A092765(n) + (11*n+9)*A092765(n+1))/(2*(5*n+3)*(2*n+3)) (based on guessed recurrence). - Mark van Hoeij, Jul 14 2010
A(x) satisfies A(x)+A(x)^2 = A000108(x)-1, a(n) = (1/n)*Sum_{k=1..n} (-1)^(k+1) * C(2*n,n-k)*C(2*k-2,k-1). - Vladimir Kruchinin, May 12 2012
G.f.: (sqrt((2 - 2*sqrt(1-4*x) - 3*x)/x) - 1)/2. - Benedict W. J. Irwin, Sep 24 2016
a(n) ~ 4^n/(sqrt(5*Pi)*n^(3/2)). - Vaclav Kotesovec, Sep 25 2016
Conjecture: 2*n*(2*n+1)*a(n) + (17*n^2-53*n+24)*a(n-1) + 6*(-13*n^2+43*n-36)*a(n-2) - 108*(2*n-5)*(n-3)*a(n-3) = 0. - R. J. Mathar, Oct 08 2016
a(n) = (1/n)*Sum_{k=0..n} binomial(n,k)*binomial(n,2*n-3*k-1). - David Nguyen, Dec 31 2016
From Alexander Burstein, Dec 12 2019: (Start)
1 + x*A(x) = 1/C(-x*C(x)^2), where C(x) is the g.f. of A000108.
F(x) = x*(1+x*A(x)) = x/C(-x*C(x)^2) is a pseudo-involution, i.e., the series reversion of x*(1 + x*A(x)) is x*(1 - x*A(-x)).
The B-sequence of F(x) is A069271, i.e., F(x) = x + x*F(x)*A069271(x*F(x)). (End)

A117813 Consider 1-D random walk with jumps up to the third neighbor, i.e., set of possible jumps is {-3,-2,-1,+1,+2,+3}. Sequence gives number of paths of length n ending at origin.

Original entry on oeis.org

1, 0, 6, 18, 122, 600, 3450, 18914, 107338, 606816, 3466356, 19852470, 114239642, 659275760, 3815952426, 22138925718, 128718762250, 749773729952, 4374616990332, 25561798008252, 149562047056572, 876140945014640, 5138089929141890, 30162194533001982
Offset: 0

Views

Author

Sergey Perepechko, Apr 30 2006

Keywords

Crossrefs

Cf. A092765.

Programs

  • Maple
    a:=array(0..25,[1,0,6,18,122,600,3450]): for n from 0 to 18 do a[n + 7]:=(36864*(n + 1)*(n + 2)*(n + 3)*a[n] - 3072*(n + 2)*(n + 3)*(97*n + 142)*a[n + 1] - 64*(n + 3)*(4031*n^2 + 17601*n + 19504)*a[n + 2] - (26944*n^3 + 215856*n^2 + 498848*n + 243840)*a[n + 3] + (15912*n^3 + 173328*n^2 + 687072*n + 997512)*a[n + 4] + (1868*n^3 + 28044*n^2 + 143368*n + 249960)*a[n + 5] - 2*(n + 6)*(115*n^2 + 1080*n + 2273)*a[n + 6])/(3*(n + 7)*(3*n + 19)*(3*n + 20)) od;
    a:=n->add(add(binomial(n,m)*binomial(n,2*n-4*m+2*k)*binomial(2*n-4*m+2*k,k),m=ceil((n+2*k)/4)..floor((n+k)/2)),k=0..n);
  • Mathematica
    f[n_] := Sum[ Binomial[n, m] Binomial[n, 2 n - 4 m + 2 k] Binomial[2 n - 4 m + 2 k, k], {k, 0, n}, {m, Ceiling[(n + 2 k)/4], Floor[(n + k)/2]}]; Array[f, 21, -1]

Formula

Recurrence: 36864*(n + 1)*(n + 2)*(n + 3)*a(n) - 3072*(n + 2)*(n + 3)*(97*n + 142)*a(n + 1) - 64*(n + 3)*(4031*n^2 + 17601*n + 19504)*a(n + 2) - (26944*n^3 + 215856*n^2 + 498848*n + 243840)*a(n + 3) + (15912*n^3 + 173328*n^2 + 687072*n + 997512)*a(n + 4) + (1868*n^3 + 28044*n^2 + 143368*n + 249960)*a(n + 5) - 2*(n + 6)*(115*n^2 + 1080*n + 2273)*a(n + 6) - 3*(n + 7)*(3*n + 19)*(3*n + 20)*a(n + 7) = 0.
O.d.e. for g.f.: x^2*(6*x - 1)^2*(8*x + 1)^2*(2*x + 1)*(8*x^2 - 68*x - 27)*(d^3/dx^3)G(x) + 6*x*(6*x - 1)*(8*x + 1)*(1152*x^5 - 6640*x^4 - 4164*x^3 - 500*x^2 - 3*x + 9)*(d^2/dx^2)G(x) + 6*(110592*x^7 - 390144*x^6 - 122048*x^5 + 11416*x^4 + 10420*x^3 + 820*x^2 + 84*x - 1)*(d/dx)G(x) + 24*x*(9216*x^5 - 11520*x^4 - 1136*x^3 + 1562*x^2 + 171*x + 30)*G(x) = 0.
Algebraic equation for generating function: (16x^2+8x-1)^2+4(6x-1)(2x+1)(1216x^4+832x^3+4x^2-46x+7)G(x)^2+2(6x-1)^2(2x+1)^2(9120x^4+3744x^3-1264x^2-212x+135)G(x)^4+4(6x-1)^3(2x+1)^3(68x^2+10x-9)(8x^2-68x-27)G(x)^6+(6x-1)^4(2x+1)^4(8x^2-68x-27)^2G(x)^8=0. - Sergey Perepechko, Mar 31 2010

A181072 Consider 1-D random walk with jumps up to the fourth neighbor, i.e., set of possible jumps is {-4,-3,-2,-1,+1,+2,+3,+4}. Sequence gives number of paths of length n ending at origin.

Original entry on oeis.org

1, 0, 8, 36, 296, 2030, 15200, 112308, 845320, 6386076, 48582438, 371138460, 2846769992, 21905812786, 169041544568, 1307602672376, 10136307859080, 78721657307320, 612391634798156, 4770987007606224, 37219155177139126, 290702353768374570, 2273036878855399720
Offset: 0

Views

Author

Sergey Perepechko, Jan 23 2011

Keywords

Crossrefs

Programs

  • Maple
    a:=n->add(binomial(n,k)*(add(binomial(n,m)*binomial(n,2*k+2*n-5*m),m=ceil((2*k+n)/5)..floor(2*(n+k)/5))),k=0..n);

Formula

Exact formula:
a(n) = sum(binomial(n, k) * (sum(binomial(n, m) * binomial(n, 2*k + 2*n - 5*m), m = ceiling((2*k + n)/5)..floor(2*(n+k)/5))), k=0..n).
Recurrence:
128000000 * (2 * n + 1) * (n + 3) * (n + 2) * (n + 1) * a(n) - 6400000 * (n + 3) * (n + 2) * (99 * n^2 + 185 * n + 50) * a(n + 1) -16000 * (n + 3) * (36954 * n^3 + 183733 * n^2 + 299913 * n + 167000) * a(n + 2) - 800 * (-1263000 + 505346 * n + 1523457 *n^2 + 630883 * n^3 + 76989 * n^4) * a(n + 3) + 80 * (71669625 + 72733160 * n + 28214529 * n^2 + 5186629 * n^3 + 389781 * n^4) * a(n + 4) + 8 * (172598700 + 157978087 * n + 52620462 * n^2 + 7605827 * n^3 + 403092 * n^4) * a(n + 5) - 4 * (92866218 + 67549595 * n + 19555350 * n^2 + 2588005 * n^3 + 129192 * n^4) * a(n + 6) - 2 * (52403820 + 30999812 * n + 6869373 * n^2 + 675772 * n^3 + 24903 * n^4) * a(n + 7) + (n + 8) * (2763 * n^3 + 53150 * n^2 + 321017 * n + 579030) * a(n + 8) + 8 * (4 * n + 35) * (n + 9) * (4 * n + 33) * (2 * n + 17) * a(n + 9) = 0
Algebraic equation for generating function:
- (400 * x^5 + 6240 * x^4 + 20376 * x^3 + 2200 * x^2 + 9 * x - 48)^2 * x^2 + 8 * (8 * x - 1) * (800000 * x^11 + 11760000 * x^10 + 78809600 * x^9 + 443644960 * x^8 + 2350482624 * x^7 + 155829416 * x^6 - 139281808 * x^5 - 52419090 * x^4 + 2482459 * x^3 + 1367208 * x^2 - 83328 * x - 2048) * g(x)^2 * x - 4 * (28000000 * x^11 + 40800000 * x^10 + 1233968000 * x^9 - 3953176000 * x^8 + 75242361184 * x^7 + 11694517328 * x^6 - 7030304072 * x^5 - 1845621940 * x^4 + 821550463 * x^3 + 67315608 * x^2 - 30631040 * x + 1921024) * (8 * x - 1)^2 * g(x)^4 * x + 8 * (140000000 * x^12 - 1194000000 * x^11 + 11067600000 * x^10 - 78000428000 * x^9 + 281516359680 * x^8 + 139037614344 * x^7 - 34486520616 * x^6 - 12507324570 * x^5 + 2600603973 * x^4 - 136469008 * x^3 - 136037760 * x^2 + 31825920 * x - 2097152) * (8 * x - 1)^3 * g(x)^6 - 2 * (3500000000 * x^12 - 53400000000 * x^11 + 453587200000 * x^10 - 2350791440000 * x^9 + 3738567060000 * x^8 + 4916593964640 * x^7 + 405974360448 * x^6 - 629094250008 * x^5 - 20410907037 * x^4 + 50599387568 * x^3 - 906930048 * x^2 - 1473314816 * x + 142606336) * (8 * x - 1)^4 * g(x)^8 + 8 * (500 * x^3 - 1200 * x^2 - 1227 * x - 256) * (7000000 * x^9 - 114300000 * x^8 + 798610000 * x^7 - 2019518000 * x^6 - 1531462308 * x^5 + 192490034 * x^4 + 195987449 * x^3 - 14097912 * x^2 - 7290368 * x + 917504) * (8 * x - 1)^5 * g(x)^10 - 4 * (70000 * x^6 - 990000 * x^5 + 4067760 * x^4 + 1850948 * x^3 - 408249 * x^2 - 120408 * x + 22528) * (500 * x^3 - 1200 * x^2 - 1227 * x - 256)^2 * (8 * x - 1)^6 * g(x)^12 + 8 * (100 * x^3 - 870 * x^2 - 177 * x + 64) * (500 * x^3 - 1200 * x^2 - 1227 * x - 256)^3 * (8 * x - 1)^7 * g(x)^14 - (500 * x^3 - 1200 * x^2 - 1227 * x - 256)^4 * (8 * x - 1)^8 * g(x)^16 = 0

A372411 Coefficient of x^n in the expansion of ( (1-x+x^2)^2 / (1-x)^3 )^n.

Original entry on oeis.org

1, 1, 7, 34, 183, 1001, 5578, 31459, 179063, 1026493, 5918007, 34277728, 199309146, 1162682314, 6801575641, 39885002534, 234384591991, 1379936226605, 8137835460115, 48062073927739, 284233390132183, 1682950066882489, 9975692904121556, 59190095764321975
Offset: 0

Views

Author

Seiichi Manyama, Apr 29 2024

Keywords

Crossrefs

Programs

  • PARI
    a(n, s=2, t=2, u=3) = sum(k=0, n\s, binomial(t*n, k)*binomial((u-t+1)*n-(s-1)*k-1, n-s*k));

Formula

a(n) = Sum_{k=0..floor(n/2)} binomial(2*n,k) * binomial(2*n-k-1,n-2*k).
The g.f. exp( Sum_{k>=1} a(k) * x^k/k ) has integer coefficients and equals (1/x) * Series_Reversion( x * (1-x)^3 / (1-x+x^2)^2 ). See A369229.
Showing 1-7 of 7 results.