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

A025177 Triangular array, read by rows: first differences in n,n direction of trinomial array A027907.

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 2, 1, 1, 1, 2, 4, 4, 4, 2, 1, 1, 3, 7, 10, 12, 10, 7, 3, 1, 1, 4, 11, 20, 29, 32, 29, 20, 11, 4, 1, 1, 5, 16, 35, 60, 81, 90, 81, 60, 35, 16, 5, 1, 1, 6, 22, 56, 111, 176, 231, 252, 231, 176, 111, 56, 22, 6, 1, 1, 7, 29, 84, 189, 343, 518, 659, 714, 659, 518, 343
Offset: 0

Views

Author

Keywords

Comments

The Motzkin transforms of the rows starting (1, 2), (1, 3) and (1, 4), extended by zeros after their last element, are apparently in A026134, A026109 and A026110. - R. J. Mathar, Dec 11 2008

Examples

			               1
            1  0  1
         1  1  2  1  1
      1  2  4  4  4  2  1
   1  3  7 10 12 10  7  3  1
1  4 11 20 29 32 29 20 11  4  1
		

Crossrefs

Columns include A025178, A025179, A025180, A025181, A025182.
Cf. A024996, A025192 (row sums).

Programs

  • Maple
    A025177 := proc(n,k)
        option remember;
        if k < 0 or k > 2*n then
            0;
        elif n = 0 then
            1 ;
        elif n = 1 then
            op(k+1,[1,0,1]) ;
        else
            procname(n-1,k-2)+procname(n-1,k-1)+procname(n-1,k) ;
        end if;
    end proc:
    seq(seq(A025177(n,k),k=0..2*n),n=0..20)  ; # R. J. Mathar, Feb 25 2015
  • Mathematica
    nmax = 10; CoefficientList[CoefficientList[Series[(1 - y*x)/(1 - x*(1 + y + y^2)), {x, 0, nmax}, {y, 0, 2*nmax}], x], y] // Flatten (* G. C. Greubel, May 22 2017; amended by Georg Fischer, Jun 24 2020 *)
  • PARI
    {T(n, k) = if( k<0 || k>2*n, 0, if( n==0, 1, if( n==1, [1,0,1][k+1], if( n==2, [1,1,2,1,1][k+1], T(n-1, k-2) + T(n-1, k-1) + T(n-1, k)))))};
    
  • PARI
    T(n,k)=polcoeff(Ser(polcoeff(Ser((1-y*z)/(1-z*(1+y+y^2)),y),k,y),z),n,z)
    
  • PARI
    {T(n, k) = if( k<0 || k>2*n, 0, if( n==0, 1, polcoeff( (1 + x + x^2)^n, k) - polcoeff( (1 + x + x^2)^(n-1), k-1)))};
    
  • PARI
    g=matrix(33,65);
    for(n=0,32,for(k=0,2*n,g[n+1,k+1]=0));
    g[1,1]=1;
    g[2,1]=1;g[2,2]=0;g[2,3]=1;
    g[3,1]=1;g[3,2]=1;g[3,3]=2;g[3,4]=1;g[3,5]=1;
    for(n=0,2,for(k=0,2*n,print(n," ",k," ",g[n+1,k+1])))
    for(n=3,32,g[n+1,1]=1;print(n," 1 1");g[n+1,2]=n-1;print(n," 2 ",n-1);for(k=2,2*n,g[n+1,k+1]=g[n,k-1]+g[n,k]+g[n,k+1];print(n," ",k," ",g[n+1,k+1])))
    \\ Michael B. Porter, Feb 02 2010

Formula

T(n, k) = T(n-1, k-2) + T(n-1, k-1) + T(n-1, k), starting with [1], [1, 0, 1].
G.f.: (1-y*z)/[1-z*(1+y+y^2)].

Extensions

Edited by Ralf Stephan, Jan 09 2005
Offset corrected by R. J. Mathar, Feb 25 2015

A098123 Number of compositions of n with equal number of even and odd parts.

Original entry on oeis.org

1, 0, 0, 2, 0, 4, 6, 6, 24, 28, 60, 130, 190, 432, 770, 1386, 2856, 5056, 9828, 18918, 34908, 68132, 128502, 244090, 470646, 890628, 1709136, 3271866, 6238986, 11986288, 22925630, 43932906, 84349336, 161625288, 310404768, 596009494
Offset: 0

Views

Author

Vladeta Jovovic, Sep 24 2004

Keywords

Examples

			From _Gus Wiseman_, Jun 26 2022: (Start)
The a(0) = 1 through a(7) = 6 compositions (empty columns indicated by dots):
  ()  .  .  (12)  .  (14)  (1122)  (16)
            (21)     (23)  (1212)  (25)
                     (32)  (1221)  (34)
                     (41)  (2112)  (43)
                           (2121)  (52)
                           (2211)  (61)
(End)
		

Crossrefs

For partitions: A045931, ranked by A325698, strict A239241 (conj A352129).
Column k=0 of A242498.
Without multiplicity: A242821, for partitions A241638 (ranked by A325700).
These compositions are ranked by A355321.
A047993 counts balanced partitions, ranked by A106529.
A108950/A108949 count partitions with more odd/even parts.
A130780/A171966 count partitions with more or as many odd/even parts.
Cf. A025178.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Count[#,?EvenQ]==Count[#,?OddQ]&]],{n,0,15}] (* Gus Wiseman, Jun 26 2022 *)

Formula

a(n) = Sum_{k=floor(n/3)..floor(n/2)} C(2*n-4*k,n-2*k)*C(n-1-k,2*n-4*k-1).
Recurrence: n*(2*n-7)*a(n) = 2*(n-2)*(2*n-5)*a(n-2) + 2*(2*n-7)*(2*n-3)*a(n-3) - (n-4)*(2*n-3)*a(n-4). - Vaclav Kotesovec, May 01 2014
a(n) ~ sqrt(c) * d^n / sqrt(Pi*n), where d = 1.94696532812840456026081823863... is the root of the equation 1-4*d-2*d^2+d^4 = 0, c = 0.225563290820392765554898545739... is the root of the equation 43*c^4-18*c^2+8*c-1=0. - Vaclav Kotesovec, May 01 2014
G.f.: 1/sqrt(1 - 4*x^3/(1-x^2)^2). - Seiichi Manyama, May 01 2025

A097893 Partial sums of the central trinomial coefficients (A002426).

Original entry on oeis.org

1, 2, 5, 12, 31, 82, 223, 616, 1723, 4862, 13815, 39468, 113257, 326198, 942425, 2730032, 7926659, 23061590, 67214399, 196211252, 573590621, 1678941350, 4920076877, 14433305000, 42381641381, 124558477682, 366371703833
Offset: 0

Views

Author

Emeric Deutsch, Sep 03 2004

Keywords

Comments

a(n) is the number of peaks at odd height in all Motzkin paths of length n+2. Example: a(2)=5 counts the peaks shown between parentheses in the 9 Motzkin paths of length 4: HHHH, HH(UD), H(UD)H, HUHD, (UD)HH, (UD)(UD), UHDH, UHHD and UUDD.
Binomial transform of 1,1,2,2,6,6,20,20,70,70...... (A000984 doubled). It would appear that the Hankel transform of this sequence is a signed version of A128055, with sign pattern given by s(n)=(2/3-sqrt(3)/3)cos(5*Pi*n/6)-sin(5*Pi*n/6)/3+(sqrt(3)/3+2/3)*cos(Pi*n/6)-sin(Pi*n/6)/3-cos(Pi*n/2)/3+sin(Pi*n/2)/3. - Paul Barry, Jan 03 2008
Define triangle T(n,1) = T(n,n) = 1 and T(r,c) = T(r,c-1) + T(r-1,c-1) + T(r-2,c-1). Then the sum of the terms in row(n) is a(n+1). - J. M. Bergot, Apr 30 2013

Crossrefs

Programs

  • Haskell
    a097893 n = a097893_list !! n
    a097893_list = scanl1 (+) a002426_list
    -- Reinhard Zumkeller, Jan 22 2013
    
  • Maple
    ser:=series(1/(1-z)/sqrt(1-2*z-3*z^2),z=0,32): 1,seq(coeff(ser,z^n),n=1..31);
    a := n -> (n+1)*hypergeom([1/2,(1-n)/2,-n/2],[1,3/2],4):
    seq(simplify(a(n)), n=0..26); # Peter Luschny, Oct 29 2015
  • Mathematica
    Table[ Sum[ Binomial[n, k]*Binomial[k, n-k], {k, 0, n}], {n, 0, 26}] // Accumulate (* Jean-François Alcover, Jul 10 2013 *)
    CoefficientList[Series[1/((1-x)*Sqrt[1-2*x-3*x^2]), {x, 0, 50}], x] (* G. C. Greubel, Dec 21 2017 *)
  • PARI
    a(n)=sum(i=0,n,sum(j=0,i,binomial(i,i-j)*binomial(j,i-j)))
    
  • PARI
    vector(30, n, n--; sum(k=0, n\2, binomial(n+1, 2*k+1)* binomial(2*k, k))) \\ Altug Alkan, Oct 29 2015
    
  • PARI
    x='x+O('x^30); Vec(1/((1-x)*sqrt(1-2*x-3*x^2))) \\ G. C. Greubel, Dec 21 2017
    
  • Python
    from math import comb
    def A097893(n): return sum(comb(n+1,(k<<1)|1)*comb(k<<1,k) for k in range((n>>1)+1)) # Chai Wah Wu, Aug 14 2025

Formula

G.f.: 1/((1-z)*sqrt(1-2*z-3*z^2)).
a(n) = Sum_{0<=j<=i<=n} C(i, i-j)*C(j, i-j). - Benoit Cloitre, Oct 23 2004
a(n) = sum_{k=0..n} Sum_{j=0..n-k} C(k,j)C(n-k,j)C(2j,j). - Paul Barry, Jan 03 2008
Logarithm g.f. atan(x*M(x)), M(x) - o.g.f. for Motzkin numbers (A001006). - Vladimir Kruchinin_, Aug 11 2010
D-finite with recurrence -n*a(n) +(3*n-1)*a(n-1) +(n-2)*a(n-2) +3*(1-n)*a(n-3)=0. - R. J. Mathar, Nov 09 2012 [Since A002426(n) = a(n) - a(n-1), this third-order recurrence follows easily from the second-order recurrence given in A002426. - Peter Bala, Oct 28 2015]
G.f.: G(0)/(1-x), where G(k)= 1 + x*(2+3*x)*(4*k+1)/( 4*k+2 - x*(2+3*x)*(4*k+2)*(4*k+3)/(x*(2+3*x)*(4*k+3) + 4*(k+1)/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jun 29 2013
a(n) ~ 3^(n+3/2)/(4*sqrt(Pi*n)). - Vaclav Kotesovec, Oct 23 2013
a(n) = Sum_{k = 0..floor(n/2)} binomial(n + 1,2*k + 1) *binomial(2*k,k). Cf. A025178. - Peter Bala, Oct 28 2015
a(n) = (n+1)*hypergeom([1/2,(1-n)/2,-n/2],[1,3/2],4). - Peter Luschny, Oct 29 2015
a(n) = (n+1)*Sum_{k=0..floor(n/2)} multinomial(n;n-2*k,k,k)/(2*k+1). - Chai Wah Wu, Aug 14 2025

A376809 Expansion of 1/sqrt(1 - 4*x^3/(1 - x)^2).

Original entry on oeis.org

1, 0, 0, 2, 4, 6, 14, 34, 72, 154, 346, 774, 1714, 3822, 8574, 19238, 43204, 97254, 219286, 494962, 1118502, 2530522, 5730762, 12989634, 29467718, 66901378, 151996338, 345556218, 786092266, 1789284762, 4074927962, 9284968682, 21166439112, 48273612954, 110142596298
Offset: 0

Views

Author

Seiichi Manyama, Oct 04 2024

Keywords

Crossrefs

Partial sums are A098479.

Programs

  • PARI
    my(N=40, x='x+O('x^N)); Vec(1/sqrt(1-4*x^3/(1-x)^2))
    
  • PARI
    a(n) = sum(k=0, n\3, binomial(2*k,k) * binomial(n-k-1,n-3*k));

Formula

a(n) = Sum_{k=0..floor(n/3)} binomial(2*k,k) * binomial(n-k-1,n-3*k).

A385641 Partial sums of A097893.

Original entry on oeis.org

1, 3, 8, 20, 51, 133, 356, 972, 2695, 7557, 21372, 60840, 174097, 500295, 1442720, 4172752, 12099411, 35161001, 102375400, 298586652, 872177273, 2551118623, 7471195500, 21904500500, 64286141881, 188844619563, 555216323396, 1633658183432, 4810340397375, 14173698242137
Offset: 0

Views

Author

Mélika Tebni, Aug 03 2025

Keywords

Comments

Second partial sums of the central trinomial coefficients (A002426).
Third partial sums of A025178 (sequence starting 1, 0, 2, 4, 12, 32, 90 .... with offset 0).
For p prime of the form 4*k + 3 (A002145), a(p) + 1 == 0 (mod p).
For p Pythagorean prime (A002144), a(p) - 3 == 0 (mod p).
Sequences with g.f. (1-x)^k / sqrt(1-2*x-3*x^2): this sequence (k=-2), A097893 (k=-1), A002426 (k=0), A025178 (k=1), A024997 (k=2), A026083 (k=3). - Mélika Tebni, Aug 25 2025

Crossrefs

Programs

  • Maple
    a := series(exp(x)*(BesselI(0, 2*x) + 2*int(BesselI(0, 2*x), x) + int(int(BesselI(0, 2*x), x), x)), x = 0, 30): seq(n!*coeff(a, x, n), n = 0 .. 29);
  • PARI
    a(n) = sum(k=0, n, sum(i=0, k, sum(j=0, i, binomial(i, i-j)*binomial(j, i-j)))); \\ Michel Marcus, Aug 06 2025
  • Python
    from math import comb as C
    def a(n):
        return sum(C(n+1, k+1)*C(2*(k//2), k//2) for k in range(n + 1))
    print([a(n) for n in range(30)])
    

Formula

G.f.: (1 / sqrt((1 + x)*(1 - 3*x))) / (1 - x)^2.
E.g.f.: exp(x)*(BesselI(0, 2*x) + 2*g(x) + Integral_{x=-oo..oo} g(x) dx) where g(x) = Integral_{x=-oo..oo} BesselI(0, 2*x) dx.
D-finite with recurrence n*a(n) = (4*n-1)*a(n-1) - (2*n+1)*a(n-2) - (4*n-5)*a(n-3) + 3*(n-1)*a(n-4).
a(0) = 1, a(1) = 3 and a(n) = a(n-2) - 1 + 2*A383527(n) for n >= 2.
a(n) = Sum_{k=0..n} binomial(n+1, k+1)*A128014(k).
a(n) = Sum_{k=0..n} (2*A247287(k) + k+1).
a(n) ~ 3^(n + 5/2) / (8*sqrt(Pi*n)). - Vaclav Kotesovec, Aug 03 2025
Showing 1-5 of 5 results.