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-10 of 31 results. Next

A357136 Triangle read by rows where T(n,k) is the number of integer compositions of n with alternating sum k = 0..n. Part of the full triangle A097805.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 0, 2, 0, 1, 3, 0, 3, 0, 1, 0, 6, 0, 4, 0, 1, 10, 0, 10, 0, 5, 0, 1, 0, 20, 0, 15, 0, 6, 0, 1, 35, 0, 35, 0, 21, 0, 7, 0, 1, 0, 70, 0, 56, 0, 28, 0, 8, 0, 1, 126, 0, 126, 0, 84, 0, 36, 0, 9, 0, 1, 0, 252, 0, 210, 0, 120, 0, 45, 0, 10, 0, 1
Offset: 0

Views

Author

Gus Wiseman, Sep 30 2022

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			Triangle begins:
    1
    0   1
    1   0   1
    0   2   0   1
    3   0   3   0   1
    0   6   0   4   0   1
   10   0  10   0   5   0   1
    0  20   0  15   0   6   0   1
   35   0  35   0  21   0   7   0   1
    0  70   0  56   0  28   0   8   0   1
  126   0 126   0  84   0  36   0   9   0   1
    0 252   0 210   0 120   0  45   0  10   0   1
  462   0 462   0 330   0 165   0  55   0  11   0   1
    0 924   0 792   0 495   0 220   0  66   0  12   0   1
For example, row n = 5 counts the following compositions:
  .  (32)     .  (41)   .  (5)
     (122)       (113)
     (221)       (212)
     (1121)      (311)
     (2111)
     (11111)
		

Crossrefs

The full triangle counting compositions by alternating sum is A097805.
The version for partitions is A103919, full triangle A344651.
This is the right-half of even-indexed rows of A260492.
The triangle without top row and left column is A108044.
Ranking and counting compositions:
- product = sum: A335404, counted by A335405.
- sum = twice alternating sum: A348614, counted by A262977.
- length = alternating sum: A357184, counted by A357182.
- length = absolute value of alternating sum: A357185, counted by A357183.
A003242 counts anti-run compositions, ranked by A333489.
A011782 counts compositions.
A025047 counts alternating compositions, ranked by A345167.
A032020 counts strict compositions, ranked by A233564.
A124754 gives alternating sums of standard compositions.
A238279 counts compositions by sum and number of maximal runs.

Programs

  • Mathematica
    Prepend[Table[If[EvenQ[nn],Prepend[#,0],#]&[Riffle[Table[Binomial[nn,k],{k,Floor[nn/2],nn}],0]],{nn,0,10}],{1}]

A357182 Number of integer compositions of n with the same length as their alternating sum.

Original entry on oeis.org

1, 1, 0, 0, 1, 3, 1, 4, 6, 20, 13, 48, 50, 175, 141, 512, 481, 1719, 1491, 5400, 4929, 17776, 15840, 57420, 52079, 188656, 169989, 617176, 559834, 2033175, 1842041, 6697744, 6085950, 22139780, 20123989, 73262232, 66697354, 242931321, 221314299, 806516560
Offset: 0

Views

Author

Gus Wiseman, Sep 28 2022

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			The a(1) = 1 through a(8) = 6 compositions:
  (1)  (31)  (113)  (42)  (124)  (53)
             (212)        (223)  (1151)
             (311)        (322)  (2141)
                          (421)  (3131)
                                 (4121)
                                 (5111)
		

Crossrefs

For product instead of length we have A114220.
For sum equal to twice alternating sum we have A262977, ranked by A348614.
For product equal to sum we have A335405, ranked by A335404.
For absolute value we have A357183.
These compositions are ranked by A357184.
The case of partitions is A357189.
A003242 counts anti-run compositions, ranked by A333489.
A011782 counts compositions.
A025047 counts alternating compositions, ranked by A345167.
A124754 gives alternating sums of standard compositions.
A238279 counts compositions by sum and number of maximal runs.
A261983 counts non-anti-run compositions.
A357136 counts compositions by alternating sum.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Length[#]==ats[#]&]],{n,0,15}]

Extensions

a(21)-a(39) from Alois P. Heinz, Sep 29 2022

A357189 Number of integer partitions of n with the same length as alternating sum.

Original entry on oeis.org

1, 1, 0, 0, 1, 1, 1, 2, 2, 4, 3, 5, 6, 9, 9, 13, 16, 23, 23, 34, 37, 54, 54, 78, 84, 120, 121, 170, 182, 252, 260, 358, 379, 517, 535, 725, 764, 1030, 1064, 1427, 1494, 1992, 2059, 2733, 2848, 3759, 3887, 5106, 5311, 6946, 7177, 9345, 9701, 12577, 12996, 16788
Offset: 0

Views

Author

Gus Wiseman, Sep 30 2022

Keywords

Comments

A partition of n is a weakly decreasing sequence of positive integers summing to n.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			The a(4) = 1 through a(13) = 9 partitions:
  31   311   42   322   53     333     64     443     75       553
                  421   5111   432     5221   542     5331     652
                               531     6211   641     6222     751
                               51111          52211   6321     52222
                                              62111   7311     53311
                                                      711111   62221
                                                               63211
                                                               73111
                                                               7111111
		

Crossrefs

For product equal to sum we have A001055, compositions A335405.
For product instead of length we have A004526, compositions A114220.
The version for compositions is A357182, ranked by A357184.
For sum equal to twice alternating sum we have A357189 (this sequence).
These partitions are ranked by A357486.
The reverse version is A357487, ranked by A357485.
A000041 counts partitions, strict A000009.
A025047 counts alternating compositions.
A103919 counts partitions by alternating sum, full triangle A344651.
A357136 counts compositions by alternating sum, full triangle A097805.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Length[Select[IntegerPartitions[n],Length[#]==ats[#]&]],{n,0,30}]

A357184 Numbers k such that the k-th composition in standard order has the same length as its alternating sum.

Original entry on oeis.org

0, 1, 9, 19, 22, 28, 34, 69, 74, 84, 104, 132, 135, 141, 153, 177, 225, 265, 271, 274, 283, 286, 292, 307, 310, 316, 328, 355, 358, 364, 376, 400, 451, 454, 460, 472, 496, 520, 523, 526, 533, 538, 553, 562, 593, 610, 673, 706, 833, 898, 1041, 1047, 1053, 1058
Offset: 1

Views

Author

Gus Wiseman, Sep 28 2022

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			The sequence together with the corresponding compositions begins:
    0: ()
    1: (1)
    9: (3,1)
   19: (3,1,1)
   22: (2,1,2)
   28: (1,1,3)
   34: (4,2)
   69: (4,2,1)
   74: (3,2,2)
   84: (2,2,3)
  104: (1,2,4)
  132: (5,3)
  135: (5,1,1,1)
  141: (4,1,2,1)
  153: (3,1,3,1)
  177: (2,1,4,1)
  225: (1,1,5,1)
		

Crossrefs

See link for sequences related to standard compositions.
For product equal to sum we have A335404, counted by A335405.
For sum equal to twice alternating sum we have A348614, counted by A262977.
These compositions are counted by A357182.
For absolute value we have A357184, counted by A357183.
The case of partitions is counted by A357189.
A003242 counts anti-run compositions, ranked by A333489.
A011782 counts compositions.
A025047 counts alternating compositions, ranked by A345167.
A032020 counts strict compositions, ranked by A233564.
A124754 gives alternating sums of standard compositions.
A238279 counts compositions by sum and number of maximal runs.
A357136 counts compositions by alternating sum.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Select[Range[0,100],Length[stc[#]]==ats[stc[#]]&]

A224274 a(n) = binomial(4*n,n)/4.

Original entry on oeis.org

1, 7, 55, 455, 3876, 33649, 296010, 2629575, 23535820, 211915132, 1917334783, 17417133617, 158753389900, 1451182990950, 13298522298180, 122131734269895, 1123787895356412, 10358022441395860, 95615237915961100, 883829035553043580, 8179808679272664720, 75788358475481302185
Offset: 1

Views

Author

Gary Detlefs, Apr 02 2013

Keywords

Comments

In general, binomial(k*n,n)/k = binomial(k*n-1,n-1).
Sequences in the OEIS related to this identity are:
. C(2n,n) = A000984, C(2n,n)/2 = A001700;
. C(3n,n) = A005809, C(3n,n)/3 = A025174;
. C(4n,n) = A005810, C(4n,n)/4 = a(n);
. C(5n,n) = A001449, C(5n,n)/5 = A163456;
. C(6n,n) = A004355, C(6n,n)/6 is not in the OEIS.
Conjecture: a(n) == 1 (mod n^3) iff n is an odd prime.
It is known that a(p) == 1(mod p^3) for prime p >= 3. See Mestrovic, Section 3. - Peter Bala, Oct 09 2015

Examples

			For n=2, binomial(4*n,n) = binomial(8,2) = 8*7/2 = 28, so a(2) = 28/4 = 7. - _Michael B. Porter_, Jul 12 2016
		

Crossrefs

Programs

  • Magma
    [Binomial(4*n,n) div 4: n in [1..25]]; // Vincenzo Librandi, Jun 03 2015
  • Maple
    seq(binomial(4*n,n)/4, n=1..17);
  • Mathematica
    Table[Binomial[4 n, n]/4, {n, 30}] (* Vincenzo Librandi, Jun 03 2015 *)
  • PARI
    a(n) = binomial(4*n,n)/4; /* Joerg Arndt, Apr 02 2013 */
    

Formula

a(n) = binomial(4*n,n)/4 = A005810(n)/4.
a(n) = binomial(4*n-1,n-1).
G.f.: A(x) = B'(x)/B(x), where B(x) = 1 + x*B(x)^4 is g.f. of A002293. - Vladimir Kruchinin, Aug 13 2015
From Peter Bala, Oct 08 2015: (Start)
a(n) = 1/2*[x^n] (C(x)^2)^n, where C(x) = (1 - sqrt(1 - 4*x))/(2*x) is the o.g.f. for the Catalan numbers A000108. Cf. A163456.
exp( Sum_{n >= 1} a(n)*x^n/n ) = 1 + x + 4*x^2 + 22*x^3 + ... is the o.g.f. for A002293.
exp( 2*Sum_{n >= 1} a(n)*x^n/n ) = 1 + 2*x + 9*x^2 + 52*x^3 + ... is the o.g.f. for A069271. (End)
From Peter Bala, Nov 04 2015: (Start)
With an offset of 1, the o.g.f. equals f(x)*g(x)^3, where f(x) is the o.g.f. for A005810 and g(x) is the o.g.f. for A002293. More generally, f(x)*g(x)^k is the o.g.f. for the sequence binomial(4*n + k,n). Cf. A262977 (k = -1), A005810 (k = 0), A052203 (k = 1), A257633 (k = 2) and A004331 (k = 4). (End)
a(n) = 1/5*[x^n] (1 + x)/(1 - x)^(3*n + 1) = 1/5*[x^n]( 1/C(-x) )^(5*n), where C(x) = (1 - sqrt(1 - 4*x))/(2*x) is the o.g.f. for the Catalan numbers A000108. Cf. A227726. - Peter Bala, Jul 12 2016
a(n) ~ 2^(8*n-3/2)*3^(-3*n-1/2)*n^(-1/2)/sqrt(Pi). - Ilya Gutkovskiy, Jul 12 2016
O.g.f.: A(x) = f(x)/(1 - 3*f(x)), where f(x) = series reversion (x/(1 + x)^4) = x + 4*x^2 + 22*x^3 + 140*x^4 + 969*x^5 + ... is the o.g.f. of A002293 with the initial term omitted. Cf. A025174. - Peter Bala, Feb 03 2022
Right-hand side of the identities (1/3)*Sum_{k = 0..n} (-1)^(n+k)*C(x*n,n-k)*C((x+3)*n+k-1,k) = C(4*n,n)/4 and (1/4)*Sum_{k = 0..n} (-1)^k*C(x*n,n-k)*C((x-4)*n+k-1,k) = C(4*n,n)/4, both valid for n >= 1 and x arbitrary. - Peter Bala, Feb 28 2022
Right-hand side of the identity (1/3)*Sum_{k = 0..2*n} (-1)^k*binomial(5*n-k-1,2*n-k)*binomial(3*n+k-1,k) = binomial(4*n,n)/4. - Peter Bala, Mar 09 2022
a(n) = [x^n] G(x)^n, where G(x) = 1 + x + 3*x^2 + 12*x^3 + 55*x^4 + 273*x^5 + ... is the g.f. of A001764. - Peter Bala, Oct 17 2024

A357488 Number of integer partitions of 2n - 1 with the same length as alternating sum.

Original entry on oeis.org

1, 0, 1, 2, 4, 5, 9, 13, 23, 34, 54, 78, 120, 170, 252, 358, 517, 725, 1030, 1427, 1992, 2733, 3759, 5106, 6946, 9345, 12577, 16788, 22384, 29641, 39199, 51529, 67626, 88307, 115083, 149332, 193383, 249456, 321134, 411998, 527472, 673233, 857539, 1089223, 1380772
Offset: 1

Views

Author

Gus Wiseman, Oct 02 2022

Keywords

Comments

A partition of n is a weakly decreasing sequence of positive integers summing to n.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			The a(1) = 1 through a(7) = 9 partitions:
  (1)  .  (311)  (322)  (333)    (443)    (553)
                 (421)  (432)    (542)    (652)
                        (531)    (641)    (751)
                        (51111)  (52211)  (52222)
                                 (62111)  (53311)
                                          (62221)
                                          (63211)
                                          (73111)
                                          (7111111)
		

Crossrefs

For product equal to sum we have A001055, compositions A335405.
The version for compositions appears to be A222763, odd version of A357182.
These are the odd-indexed terms of A357189, ranked by A357486.
These partitions are ranked by the odd-sum portion of A357485.
Except at the start, alternately adding zeros gives A357487.
A000041 counts partitions, strict A000009.
A025047 counts alternating compositions.
A103919 counts partitions by alternating sum, full triangle A344651.
A357136 counts compositions by alternating sum, full triangle A097805.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Length[Select[IntegerPartitions[n],Length[#]==ats[#]&]],{n,1,30,2}]

Formula

a(n) = A357189(2n - 1).

Extensions

More terms from Alois P. Heinz, Oct 04 2022

A357183 Number of integer compositions with the same length as the absolute value of their alternating sum.

Original entry on oeis.org

1, 1, 0, 0, 2, 3, 2, 5, 12, 22, 26, 58, 100, 203, 282, 616, 962, 2045, 2982, 6518, 9858, 21416, 31680, 69623, 104158, 228930, 339978, 751430, 1119668, 2478787, 3684082, 8182469, 12171900, 27082870, 40247978, 89748642, 133394708, 297933185, 442628598, 990210110
Offset: 0

Views

Author

Gus Wiseman, Sep 28 2022

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			The a(1) = 1 through a(8) = 12 compositions:
  (1)  (13)  (113)  (24)  (124)  (35)
       (31)  (212)  (42)  (151)  (53)
             (311)        (223)  (1115)
                          (322)  (1151)
                          (421)  (1214)
                                 (1313)
                                 (1412)
                                 (1511)
                                 (2141)
                                 (3131)
                                 (4121)
                                 (5111)
		

Crossrefs

For product instead of length we have A114220.
For sum equal to twice alternating sum we have A262977, ranked by A348614.
For product equal to sum we have A335405, ranked by A335404.
This is the absolute value version of A357182.
These compositions are ranked by A357185.
The case of partitions is A357189.
A003242 counts anti-run compositions, ranked by A333489.
A011782 counts compositions.
A025047 counts alternating compositions, ranked by A345167.
A124754 gives alternating sums of standard compositions.
A238279 counts compositions by sum and number of maximal runs.
A261983 counts non-anti-run compositions.
A357136 counts compositions by alternating sum.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Length[#]==Abs[ats[#]]&]],{n,0,15}]

Extensions

a(21)-a(39) from Alois P. Heinz, Sep 29 2022

A052203 a(n) = (4n+1)*binomial(4n,n)/(3n+1).

Original entry on oeis.org

1, 5, 36, 286, 2380, 20349, 177100, 1560780, 13884156, 124403620, 1121099408, 10150595910, 92263734836, 841392966470, 7694644696200, 70539987842520, 648045936942300, 5964720367660956, 54991682779774384, 507749884105448600, 4694436188839116720
Offset: 0

Views

Author

Barry E. Williams, Jan 28 2000

Keywords

Comments

Central terms of the triangles in A122366 and A111418. - Reinhard Zumkeller, Aug 30 2006 and Mar 14 2014
a(n) is the number of paths from (0,0) to (4n,n), taking north and east steps while avoiding exactly 2 consecutive north steps. - Shanzhen Gao, Apr 15 2010

Crossrefs

Programs

  • Haskell
    a052203 n = a122366 (2 * n) n  -- Reinhard Zumkeller, Mar 14 2014
    
  • Magma
    [Binomial(4*n+1, n): n in [0..20]]; // Vincenzo Librandi, Aug 07 2014
    
  • Mathematica
    Table[Binomial[4 n + 1, n], {n, 0, 20}] (* Vincenzo Librandi, Aug 07 2014 *)
  • PARI
    vector(30, n, n--; (4*n+1)*binomial(4*n,n)/(3*n+1)) \\ Altug Alkan, Nov 05 2015

Formula

a(n) = C(4n+1, n); a(n) is asymptotic to c/sqrt(n)*(256/27)^n with c=0.614... - Benoit Cloitre, Jan 27 2003 [c = 2^(5/2)/(3^(3/2)*sqrt(Pi)) = 0.61421182128... - Vaclav Kotesovec, Feb 14 2019]
G.f.: g^2/(4-3*g) where g = 1+x*g^4 is the g.f. of A002293. - Mark van Hoeij, Nov 11 2011
G.f.: hypergeom([1/2, 3/4, 5/4], [2/3, 4/3], (256/27)*x). - Robert Israel, Aug 07 2014
D-finite with recurrence 3*n*(3*n-1)*(3*n+1)*a(n) - 8*(4*n+1)*(2*n-1)*(4*n-1)*a(n-1)=0. - R. J. Mathar, Nov 26 2012
From Peter Bala, Nov 04 2015: (Start)
The o.g.f. equals f(x)*g(x), where f(x) is the o.g.f. for A005810 and g(x) is the o.g.f. for A002293.
More generally, f(x)*g(x)^k is the o.g.f. for the sequence binomial(4*n + k,n). Cf. A262977 (k = -1), A005810 (k = 0), A257633 (k = 2), A224274 (k = 3) and A004331 (k = 4). (End)
a(n) = [x^n] 1/(1 - x)^(3*n+2). - Ilya Gutkovskiy, Oct 03 2017
a(n) = Sum_{k = 0..n} binomial(2*n+k+1, k)*binomial(2*n-k-1, n-k). - Peter Bala, Sep 17 2024

Extensions

More terms from James Sellers, Jan 31 2000

A004331 Binomial coefficient C(4n,n-1).

Original entry on oeis.org

1, 8, 66, 560, 4845, 42504, 376740, 3365856, 30260340, 273438880, 2481256778, 22595200368, 206379406870, 1889912732400, 17345898649800, 159518999862720, 1469568786235308, 13559593014190944, 125288932441604200
Offset: 1

Views

Author

Keywords

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 828.

Crossrefs

Programs

  • Maple
    #A004331
    seq(binomial(4*n - 1,n), n = 0..20);
  • Mathematica
    a[n_] := Binomial[4*n, n - 1]; Array[a, 19] (* Amiram Eldar, May 09 2020 *)
  • PARI
    vector(30, n, binomial(4*n, n-1)) \\ Altug Alkan, Nov 05 2015

Formula

G.f.: (g^2-g)/(4-3*g) where g = 1+x*g^4 is the g.f. of A002293. - Mark van Hoeij, Nov 11 2011
With an offset of 0, the o.g.f. equals f(x)*g(x)^4, where f(x) is the o.g.f. for A005810 and g(x) is the o.g.f. for A002293. More generally, f(x)*g(x)^k is the o.g.f. for the sequence binomial(4*n + k,n). Cf. A262977 (k = -1), A005810 (k = 0), A052203 (k = 1), A257633 (k = 2) and A224274 (k = 3). - Peter Bala, Nov 04 2015
D-finite with recurrence 3*(n-1)*(3*n-1)*(3*n+1)*a(n) -8*(4*n-3)*(2*n-1)*(4*n-1)*a(n-1)=0. - R. J. Mathar, Mar 19 2025

A348614 Numbers k such that the k-th composition in standard order has sum equal to twice its alternating sum.

Original entry on oeis.org

0, 9, 11, 14, 130, 133, 135, 138, 141, 143, 148, 153, 155, 158, 168, 177, 179, 182, 188, 208, 225, 227, 230, 236, 248, 2052, 2057, 2059, 2062, 2066, 2069, 2071, 2074, 2077, 2079, 2084, 2089, 2091, 2094, 2098, 2101, 2103, 2106, 2109, 2111, 2120, 2129, 2131
Offset: 1

Views

Author

Gus Wiseman, Oct 29 2021

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			The terms together with their binary indices begin:
    0: ()
    9: (3,1)
   11: (2,1,1)
   14: (1,1,2)
  130: (6,2)
  133: (5,2,1)
  135: (5,1,1,1)
  138: (4,2,2)
  141: (4,1,2,1)
  143: (4,1,1,1,1)
  148: (3,2,3)
  153: (3,1,3,1)
  155: (3,1,2,1,1)
  158: (3,1,1,1,2)
		

Crossrefs

The unordered case (partitions) is counted by A000712, reverse A006330.
These compositions are counted by A262977.
Except for 0, a subset of A345917 (which is itself a subset of A345913).
A000346 = even-length compositions with alt sum != 0, complement A001700.
A011782 counts compositions.
A025047 counts wiggly compositions, ranked by A345167.
A034871 counts compositions of 2n with alternating sum 2k.
A097805 counts compositions by alternating (or reverse-alternating) sum.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A116406 counts compositions with alternating sum >=0, ranked by A345913.
A138364 counts compositions with alternating sum 0, ranked by A344619.
A345197 counts compositions by length and alternating sum.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,1000],Total[stc[#]]==2*ats[stc[#]]&]
Showing 1-10 of 31 results. Next