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

A030267 Compose the natural numbers with themselves, A(x) = B(B(x)) where B(x) = x/(1-x)^2 is the generating function for natural numbers.

Original entry on oeis.org

1, 4, 14, 46, 145, 444, 1331, 3926, 11434, 32960, 94211, 267384, 754309, 2116936, 5914310, 16458034, 45638101, 126159156, 347769719, 956238170, 2623278946, 7181512964, 19622668679, 53522804976, 145753273225, 396323283724, 1076167858046, 2918447861686
Offset: 1

Views

Author

Keywords

Comments

Sum of pyramid weights of all nondecreasing Dyck paths of semilength n. (A pyramid in a Dyck word (path) is a factor of the form U^h D^h, where U=(1,1), D=(1,-1) and h is the height of the pyramid. A pyramid in a Dyck word w is maximal if, as a factor in w, it is not immediately preceded by a u and immediately followed by a d. The pyramid weight of a Dyck path (word) is the sum of the heights of its maximal pyramids.) Example: a(4) = 46. Indeed, there are 14 Dyck paths of semilength 4. One of them, namely UUDUDDUD is not nondecreasing because the valleys are at heights 1 and 0. The other 13, with the maximal pyramids shown between parentheses, are: (UD)(UD)(UD)(UD), (UD)(UD)(UUDD), (UD)(UUDD)(UD), (UD)U(UD)(UD)D, (UD)(UUUDDD), (UUDD)(UD)(UD), (UUDD)(UUDD), (UUUDDD)(UD), U(UD)(UD)(UD)D, U(UD)(UUDD)D, U(UUDD)(UD)D, UU(UD)(UD)DD and (UUUUDDDD). The pyramid weights of these paths are 4, 4, 4, 3, 4, 4, 4, 4, 3, 3, 3, 2, and 4, respectively. Their sum is 46. a(n) = Sum_{k = 1..n} k*A121462(n, k). - Emeric Deutsch, Jul 31 2006
Number of 1s in all compositions of n, where compositions are understood with two different kinds of 1s, say 1 and 1' (n >= 1). Example: a(2) = 4 because the compositions of 2 are 11, 11', 1'1, 1'1', 2, having a total of 2 + 1 + 1 + 0 + 0 = 4 1s. Also number of k's in all compositions of n + k (k = 2, 3, ...). - Emeric Deutsch, Jul 21 2008
From Petros Hadjicostas, Jun 24 2019: (Start)
If c = (c(m): m >= 1) is the input sequence and b_k = (b_k(n): n >= 1) is the output sequence under the AIK[k] = INVERT[k] transform (see Bower's web link below), then the bivariate g.f. of the list of sequences (b_k: k >= 1) = ((b_k(n): n >= 1): k >= 1) is Sum_{n, k >= 1} b_k(n)*x^n*y^k = y*C(x)/(1 - y*C(x)), where C(x) = Sum_{m >= 1} c(m)*x^m is the g.f. of the input sequence.
Here, b_k(n) is the number of all (linear) compositions of n with k parts where a part of size m is colored with one of c(m) colors. Thus, Sum_{k = 1..n} k*b_k(n) is the total number of parts in all compositions of n.
If we differentiate the bivariate g.f. function above, i.e., Sum_{n, k >= 1} b_k(n)*x^n*y^k, with respect to y and set y = 1, we get the g.f. of the sequence (Sum_{k = 1..n} k*b_k(n): n >= 1). It is C(x)/(1 - C(x))^2.
When c(m) = m for all m >= 1, we have m-color compositions of n that were first studied by Agarwal (2000). The cyclic version of these m-color compositions were studied by Gibson (2017) and Gibson et al. (2018).
When c(m) = m for each m >= 1, we have C(x) = x/(1 - x)^2, and so C(x)/(1 - C(x))^2 = x * (1 - x)^2/(1 - 3*x + x^2)^2, which is the g.f. of the current sequence.
Hence, a(n) is the total number of parts in all m-color compositions of n (in the sense of Agarwal (2000)).
(End)
Series reversal gives A153294 starting from index 1, with alternating signs: 1, -4, 18, -86, 427, -2180, ... - Vladimir Reshetnikov, Aug 03 2019

Examples

			From _Petros Hadjicostas_, Jun 24 2019: (Start)
Recall that with m-color compositions, a part of size m may be colored with one of m colors.
We have a(1) = 1 because we only have one colored composition, namely 1_1, that has only 1 part.
We have a(2) = 4 because we have the following colored compositions of n = 2: 2_1, 2_2, 1_1 + 1_1; hence, a(2) = 1 + 1 + 2 = 4.
We have a(3) = 14 because we have the following colored compositions of n = 3: 3_1, 3_2, 3_3, 1_1 + 2_1, 1_1 + 2_2, 2_1 + 1_1, 2_2 + 1_1, 1_1 + 1_1 + 1_1; hence, a(3) = 1 + 1 + 1 + 2 + 2 + 2 + 2 + 3 = 14.
We have a(14) = 46 because we have the following colored compositions of n = 4:
(i) 4_1, 4_2, 4_3, 4_4; with a total of 4 parts.
(ii) 1_1 + 3_1, 1_1 + 3_2, 1_1 + 3_3, 3_1 + 1_1, 3_2 + 1_1, 3_3 + 1_1, 2_1 + 2_1, 2_1 + 2_2, 2_2 + 2_1, 2_2 + 2_2; with a total of 2 x 10 = 20 parts.
(iii) 1_1 + 1_1 + 2_1, 1_1 + 1_1 + 2_2, 1_1 + 2_1 + 1_1, 1_1 + 2_2 + 1_1, 2_1 + 1_1 + 1_1, 2_2 + 1_1 + 1_1; with a total of 3 x 6 = 18 parts.
(iv) 1_1 + 1_1 + 1_1 + 1_1; with a total of 4 parts.
Hence, a(4) = 4 + 20 + 18 + 4 = 46.
(End)
		

References

  • R. P. Grimaldi, Compositions and the alternate Fibonacci numbers, Congressus Numerantium, 186, 2007, 81-96.

Crossrefs

Partial sums of A038731. First differences of A001870.
Cf. A001629 (right-shifted inverse Binomial Transform), A023610 (inverse Binomial Transform of left-shifted sequence), A030279, A045623, A088305, A121462, A153294, A279282, A307415, A308723.

Programs

  • Maple
    with(combinat): L[0]:=2: L[1]:=1: for n from 2 to 60 do L[n]:=L[n-1] +L[n-2] end do: seq(2*fibonacci(2*n)*1/5+(1/5)*n*L[2*n],n=1..30); # Emeric Deutsch, Jul 21 2008
  • Mathematica
    Table[Sum[k Binomial[n+k-1,2k-1],{k,n}],{n,30}] (* or *) LinearRecurrence[ {6,-11,6,-1},{1,4,14,46},30] (* Harvey P. Dale, Aug 01 2011 *)
  • PARI
    a(n)=(2*n*fibonacci(2*n+1)+(2-n)*fibonacci(2*n))/5

Formula

a(n) = -a(-n) = (2n * F(2n+1) + (2 - n) * F(2n))/5 with F(n) = A000045(n) (Fibonacci numbers).
G.f.: x * (1 - x)^2/(1 - 3*x + x^2)^2.
a(n) = Sum_{k = 1..n} k*C(n + k - 1, 2*k - 1).
a(n) = (2/5)*F(2*n) + (1/5)*n*L(2*n), where F(k) are the Fibonacci numbers (F(0)=0, F(1)=1) and L(k) are the Lucas numbers (L(0) = 2, L(1) = 1). - Emeric Deutsch, Jul 21 2008
a(0) = 1, a(1) = 4, a(2) = 14, a(3) = 46, a(n) = 6*a(n-1) - 11*a(n-2) + 6*a(n-3) - a(n-4). - Harvey P. Dale, Aug 01 2011
a(n) = ((3 - sqrt(5))^n*(5*n - 2*sqrt(5)) + (3 + sqrt(5))^n*(5*n + 2*sqrt(5)))/ (25*2^n). - Peter Luschny, Mar 07 2022
E.g.f.: exp(3*x/2)*(15*x*cosh(sqrt(5)*x/2) + sqrt(5)*(4 + 5*x)*sinh(sqrt(5)*x/2))/25. - Stefano Spezia, Mar 04 2025

Extensions

Name clarified using a comment of the author by Peter Luschny, Aug 03 2019

A318942 Triangle read by rows: T(n,k) = number of Dyck paths with n nodes and altitude k (1 <= k <= n).

Original entry on oeis.org

1, 2, 1, 5, 4, 1, 13, 12, 6, 1, 34, 35, 21, 8, 1, 89, 99, 68, 32, 10, 1, 233, 274, 208, 114, 45, 12, 1, 610, 747, 612, 376, 175, 60, 14, 1, 1597, 2015, 1752, 1177, 620, 253, 77, 16, 1, 4181, 5394, 4916, 3549, 2062, 959, 350, 96, 18, 1, 10946, 14359, 13588, 10406, 6551, 3381, 1414, 468, 117, 20
Offset: 1

Views

Author

N. J. A. Sloane, Sep 18 2018

Keywords

Examples

			Triangle begins:
1,
2,1,
5,4,1,
13,12,6,1,
34,35,21,8,1,
89,99,68,32,10,1,
233,274,208,114,45,12,1,
610,747,612,376,175,60,14,1,
1597,2015,1752,1177,620,253,77,16,1,
...
		

Crossrefs

Col. 1 is alternate Fibonaccis, cols. 2, 3, 4 are A318941, A318943, A318944.
Row sums give A038731(n-1).

Programs

  • Maple
    A318942 := proc(n,k) # Theorem 7 of Czabarka et al.
        option remember;
        if k = 1 then
            combinat[fibonacci](2*n-1) ;
        elif n =k then
            1;
        elif n = k+1 then
            2*procname(n-1,k)+procname(n-1,k-1) ;
        elif n >= k+2 then
            2*procname(n-1,k)+procname(n-1,k-1)-procname(n-2,k-1)+combinat[fibonacci](2*n-2*k-2)  ;
        else
            0 ;
        end if;
    end proc:
    seq( seq(A318942(n,k),k=1..n),n=1..12 ) ; # R. J. Mathar, Apr 09 2019
  • Mathematica
    T[n_, k_] := T[n, k] = Which[k == 1, Fibonacci[2*n - 1], n == k, 1, n == k + 1, 2*T[n - 1, k] + T[n - 1, k - 1], n >= k + 2, 2*T[n - 1, k] + T[n - 1, k - 1] - T[n - 2, k - 1] + Fibonacci[2*n - 2*k - 2], True, 0];
    Table[Table[T[n, k], {k, 1, n}], {n, 1, 12}] // Flatten (* Jean-François Alcover, Sep 25 2022, after R. J. Mathar *)

Formula

Czabarka et al. give a g.f. - N. J. A. Sloane, Apr 09 2019

A121483 Number of peaks at odd level in all nondecreasing Dyck paths of semilength n. A nondecreasing Dyck path is a Dyck path for which the sequence of the altitudes of the valleys is nondecreasing.

Original entry on oeis.org

1, 2, 6, 19, 56, 167, 487, 1411, 4047, 11527, 32617, 91790, 257065, 716896, 1991792, 5515535, 15227846, 41930133, 115176023, 315676425, 863475561, 2357539227, 6425887551, 17487572124, 47522431681, 128969086382, 349567320762
Offset: 1

Views

Author

Emeric Deutsch, Aug 02 2006

Keywords

Comments

a(n) = Sum(k*A121481(n,k),k=0..n).

Examples

			a(2)=2 because in UDUD and UUDD we have altogether 2 peaks at odd level; here U=(1,1) and D=(1,-1).
		

Crossrefs

Programs

  • Maple
    G:=z*(1-z)*(1-3*z+6*z^3-3*z^4)/(1+z)/(1-3*z+z^2)^2/(1-z-z^2): Gser:=series(G,z=0,33): seq(coeff(Gser,z,n),n=1..30);
  • Mathematica
    Rest[CoefficientList[Series[x*(1-x)*(1-3*x+6*x^3-3*x^4)/(1+x)/(1-3*x+x^2)^2/(1-x-x^2), {x, 0, 20}], x]] (* Vaclav Kotesovec, Mar 20 2014 *)

Formula

G.f.: z(1-z)(1-3z+6z^3-3z^4)/[(1+z)(1-3z+z^2)^2*(1-z-z^2)].
Recurrence: (n^2 - 5*n - 20)*a(n) = (3*n^2 - 12*n - 79)*a(n-1) + (n^2 - 7*n - 16)*a(n-2) - (5*n^2 - 19*n - 138)*a(n-3) - (n^2 - 6*n - 31)*a(n-4) + (n^2 - 3*n - 24)*a(n-5). - Vaclav Kotesovec, Mar 20 2014
a(n) ~ (sqrt(5)-1) * (3+sqrt(5))^n * n / (5*2^(n+2)). - Vaclav Kotesovec, Mar 20 2014

A121486 Number of peaks at even level in all nondecreasing Dyck paths of semilength n. A nondecreasing Dyck path is a Dyck path for which the sequence of the altitudes of the valleys is nondecreasing.

Original entry on oeis.org

0, 1, 4, 13, 43, 132, 400, 1184, 3461, 9999, 28634, 81383, 229860, 645731, 1805582, 5028189, 13952221, 38590922, 106434540, 292792026, 803565215, 2200694791, 6015268164, 16412564173, 44708036568, 121600924117, 330277253560
Offset: 1

Views

Author

Emeric Deutsch, Aug 02 2006

Keywords

Examples

			a(3)=4 because in UDUDUD, UDUU|DD, UU|DDUD, UU|DU|DD and UUUDDD we have altogether 4 peaks at even level (shown by a |); here U=(1,1) and D=(1,-1).
		

Crossrefs

Programs

  • Maple
    G:=z^2*(1-z)*(1-z-3*z^2+3*z^3-z^4)/(1+z)/(1-z-z^2)/(1-3*z+z^2)^2: Gser:=series(G,z=0,33): seq(coeff(Gser,z,n),n=1..30);
  • Mathematica
    Rest[CoefficientList[Series[x^2*(1-x)*(1-x-3*x^2+3*x^3-x^4)/(1+x)/(1-x-x^2)/(1-3*x+x^2)^2, {x, 0, 20}], x]] (* Vaclav Kotesovec, Mar 20 2014 *)

Formula

a(n) = Sum(k*A121484(n,k),k=0..n-1).
G.f.: z^2*(1-z)(1-z-3z^2+3z^3-z^4)/[(1+z)(1-z-z^2)(1-3z+z^2)^2].
a(n) ~ (sqrt(5)-1) * (3+sqrt(5))^n * n / (5 * 2^(n+2)). - Vaclav Kotesovec, Mar 20 2014
20*a(n) = -8*(-1)^n +10*(2*A001871(n)-5*A001871(n-1))+5*(4*A000045(n+1)-7*A000045(n))-3*(4*A001906(n+1)+9*A001906(n)). - R. J. Mathar, Jul 26 2022

A181330 Triangle read by rows: T(n,k) is the number of 2-compositions of n having k 0's in the top row A 2-composition of n is a nonnegative matrix with two rows, such that each column has at least one nonzero entry and whose entries sum up to n.

Original entry on oeis.org

1, 1, 1, 3, 3, 1, 8, 10, 5, 1, 21, 32, 21, 7, 1, 55, 99, 80, 36, 9, 1, 144, 299, 286, 160, 55, 11, 1, 377, 887, 978, 650, 280, 78, 13, 1, 987, 2595, 3236, 2482, 1275, 448, 105, 15, 1, 2584, 7508, 10438, 9054, 5377, 2261, 672, 136, 17, 1, 6765, 21526, 32991, 31882
Offset: 0

Views

Author

Emeric Deutsch, Oct 13 2010

Keywords

Comments

The sum of entries in row n is A003480(n).
T(n,0) = A000045(2n) (n>=1), Fibonacci numbers.
T(n,1) = A038731(n-1) (n>=1).
Sum(k*T(n,k), k>=0) = A181331.
For the statistic "number of nonzero entries in the top row" see A181332.

Examples

			T(2,1)=3 because we have (0/2), (1,0/0,1), and (0,1/1,0) (the 2-compositions are written as (top row / bottom row)).
Triangle starts:
1;
1,1;
3,3,1;
8,10,5,1;
21,32,21,7,1;
55,99,80,36,9,1;
		

Crossrefs

Programs

  • Maple
    G := (1-z)^2/(1-3*z+z^2-t*z*(1-z)): Gser := simplify(series(G, z = 0, 15)): for n from 0 to 10 do P[n] := sort(coeff(Gser, z, n)) end do: for n from 0 to 10 do seq(coeff(P[n], t, k), k = 0 .. n) end do; # yields sequence in triangular form

Formula

G.f.: G(t,x) = (1-x)^2/(1-3*x+x^2-t*x(1-x)).
The g.f. of column k is x^k*(1-x)^(k+2)/(1-3*x+x^2)^(k+1) (we have a Riordan array).
T(n,k) = 3*T(n-1,k) +T(n-1,k-1) -T(n-2,k) -T(n-2,k-1), with T(0,0)=T(1,0)=T(1,1)=T(2,2)=1, T(2,0)=T(2,1)=3, T(n,k)=0 if k<0 or if k>n. - Philippe Deléham, Nov 26 2013

A121468 Triangle read by rows: T(n,k) is the number of k-cell columns in all directed column-convex polyominoes of area n (1<=k<=n).

Original entry on oeis.org

1, 2, 1, 6, 3, 1, 18, 9, 4, 1, 53, 28, 12, 5, 1, 154, 85, 38, 15, 6, 1, 443, 253, 117, 48, 18, 7, 1, 1264, 742, 352, 149, 58, 21, 8, 1, 3582, 2151, 1041, 451, 181, 68, 24, 9, 1, 10092, 6177, 3038, 1340, 550, 213, 78, 27, 10, 1, 28291, 17600, 8772, 3925, 1639, 649, 245, 88, 30, 11, 1
Offset: 1

Views

Author

Emeric Deutsch, Aug 03 2006

Keywords

Comments

Also number of ascents of length k in all nondecreasing Dyck paths of semilength n. A nondecreasing Dyck path is a Dyck path for which the sequence of the altitudes of the valleys is nondecreasing. Example: T(4,2)=9 because we have (UU)DD(UU)DD, (UU)DDUDUD, UD(UU)DDUD, UDUD(UU)DD, (UU)D(UU)DDD, (UU)DUDUDD, UD(UU)DUDD, where U=(1,1) and D=(1,-1); the ascents of length 2 are shown between parentheses; the other six nondecreasing Dyck paths of semilength 4 have no ascents of length 2. Sum of entries in row n = A038731(n-1). T(n,1)=A094864(n-1).

Examples

			Triangle starts:
1;
2,1;
6,3,1;
18,9,4,1;
53,28,12,5,1;
		

Crossrefs

Programs

  • Maple
    F:=k->z^k*(1-z)^2*(1-3*z+z^2-k*z^2+k*z)/(1-3*z+z^2)^2: T:=(n,k)->coeff(series(F(k),z=0,25),z^n): for n from 1 to 12 do seq(T(n,k),k=1..n) od; # yields sequence in triangular form

Formula

T(n,k) = Sum(j*T(n-j,k),j=1..n-k)+k*fibonacci(2n-2k-1).
G.f. of column k: z^k*(1-z)^2*(1-3z+z^2-kz^2+kz)/(1-3z+z^2)^2.
Showing 1-6 of 6 results.