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

A325545 Number of compositions of n with distinct differences.

Original entry on oeis.org

1, 1, 2, 3, 7, 13, 17, 34, 59, 105, 166, 279, 442, 730, 1157, 1927, 3045, 4741, 7527, 11667, 18048, 27928, 43334, 65861, 101385, 153404, 232287, 347643, 523721, 780083, 1165331, 1725966, 2561625, 3773838, 5561577, 8151209, 11920717, 17364461, 25269939, 36635775
Offset: 0

Views

Author

Gus Wiseman, May 10 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
The differences of a sequence are defined as if the sequence were increasing, so for example the differences of (3,1,2) are (-2,1).

Examples

			The a(1) = 1 through a(6) = 17 compositions:
  (1)  (2)   (3)   (4)    (5)     (6)
       (11)  (12)  (13)   (14)    (15)
             (21)  (22)   (23)    (24)
                   (31)   (32)    (33)
                   (112)  (41)    (42)
                   (121)  (113)   (51)
                   (211)  (122)   (114)
                          (131)   (132)
                          (212)   (141)
                          (221)   (213)
                          (311)   (231)
                          (1121)  (312)
                          (1211)  (411)
                                  (1131)
                                  (1221)
                                  (1311)
                                  (2112)
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@Differences[#]&]],{n,0,15}]

Extensions

More terms from Alois P. Heinz, May 11 2019

A175342 Number of arithmetic progressions (where the difference between adjacent terms is either positive, 0, or negative) of positive integers that sum to n.

Original entry on oeis.org

1, 2, 4, 5, 6, 10, 8, 10, 15, 14, 12, 22, 14, 18, 28, 21, 18, 34, 20, 28, 38, 28, 24, 46, 31, 32, 48, 38, 30, 62, 32, 40, 58, 42, 46, 73, 38, 46, 68, 58, 42, 84, 44, 56, 90, 56, 48, 94, 55, 70, 90, 66, 54, 106, 70, 74, 100, 70, 60, 130, 62, 74, 118, 81, 82, 130, 68, 84, 120
Offset: 1

Views

Author

Leroy Quet, Apr 17 2010

Keywords

Examples

			From _Gus Wiseman_, May 15 2019: (Start)
The a(1) = 1 through a(8) = 10 compositions with equal differences:
  (1)  (2)   (3)    (4)     (5)      (6)       (7)        (8)
       (11)  (12)   (13)    (14)     (15)      (16)       (17)
             (21)   (22)    (23)     (24)      (25)       (26)
             (111)  (31)    (32)     (33)      (34)       (35)
                    (1111)  (41)     (42)      (43)       (44)
                            (11111)  (51)      (52)       (53)
                                     (123)     (61)       (62)
                                     (222)     (1111111)  (71)
                                     (321)                (2222)
                                     (111111)             (11111111)
(End)
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],SameQ@@Differences[#]&]],{n,0,15}] (* returns a(0) = 1, Gus Wiseman, May 15 2019*)

Formula

a(n) = 2*A049988(n) - A000005(n).
G.f.: x/(1-x) + Sum_{k>=2} x^k * (1 + x^(k(k-1)/2)) / (1 - x^(k(k-1)/2)) / (1 -x^k).

Extensions

Edited and extended by Max Alekseyev, May 03 2010

A342528 Number of compositions with alternating parts weakly decreasing (or weakly increasing).

Original entry on oeis.org

1, 1, 2, 4, 7, 12, 20, 32, 51, 79, 121, 182, 272, 399, 582, 839, 1200, 1700, 2394, 3342, 4640, 6397, 8771, 11955, 16217, 21878, 29386, 39285, 52301, 69334, 91570, 120465, 157929, 206313, 268644, 348674, 451185, 582074, 748830, 960676, 1229208, 1568716, 1997064
Offset: 0

Views

Author

Gus Wiseman, Mar 24 2021

Keywords

Comments

These are finite sequences q of positive integers summing to n such that q(i) >= q(i+2) for all possible i.
The strict case (alternating parts are strictly decreasing) is A000041. Is there a bijective proof?
Yes. Construct a Ferrers diagram by placing odd parts horizontally and even parts vertically in a fishbone pattern. The resulting Ferrers diagram will be for an ordinary partition and the process is reversible. It does not appear that this method can be applied to give a formula for this sequence. - Andrew Howroyd, Mar 25 2021

Examples

			The a(1) = 1 through a(6) = 20 compositions:
  (1)  (2)   (3)    (4)     (5)      (6)
       (11)  (12)   (13)    (14)     (15)
             (21)   (22)    (23)     (24)
             (111)  (31)    (32)     (33)
                    (121)   (41)     (42)
                    (211)   (131)    (51)
                    (1111)  (212)    (141)
                            (221)    (222)
                            (311)    (231)
                            (1211)   (312)
                            (2111)   (321)
                            (11111)  (411)
                                     (1212)
                                     (1311)
                                     (2121)
                                     (2211)
                                     (3111)
                                     (12111)
                                     (21111)
                                     (111111)
		

Crossrefs

The even-length case is A114921.
The version with alternating parts unequal is A224958 (unordered: A000726).
The version with alternating parts equal is A342527.
A000041 counts weakly increasing (or weakly decreasing) compositions.
A000203 adds up divisors.
A002843 counts compositions with all adjacent parts x <= 2y.
A003242 counts anti-run compositions.
A069916/A342492 = decreasing/increasing first quotients.
A070211/A325546 = weakly decreasing/increasing differences.
A175342/A325545 = constant/distinct differences.
A342495 = constant first quotients (unordered: A342496, strict: A342515, ranking: A342522).

Programs

  • Maple
    b:= proc(n, i, j) option remember; `if`(n=0, 1, `if`(i<1, 0,
          b(n, i-1, j)+b(n-i, min(n-i, j), min(n-i, i))))
        end:
    a:= n-> b(n$3):
    seq(a(n), n=0..42);  # Alois P. Heinz, Jan 16 2025
  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],GreaterEqual@@Plus@@@Reverse/@Partition[#,2,1]&]],{n,0,15}]
  • PARI
    seq(n)={my(p=1/prod(k=1, n, 1-y*x^k + O(x*x^n))); Vec(1+sum(k=1, n, polcoef(p,k,y)*(polcoef(p,k-1,y) + polcoef(p,k,y))))} \\ Andrew Howroyd, Mar 24 2021

Formula

G.f.: Sum_{k>=0} ([y^k] P(x,y))*([y^k] (1 + y)*P(x,y)), where P(x,y) = Product_{k>=1} 1/(1 - y*x^k). - Andrew Howroyd, Jan 16 2025

Extensions

Terms a(21) and beyond from Andrew Howroyd, Mar 24 2021

A325557 Number of compositions of n with equal differences up to sign.

Original entry on oeis.org

1, 1, 2, 4, 6, 8, 13, 12, 20, 24, 25, 29, 49, 40, 50, 64, 86, 80, 105, 102, 164, 175, 186, 208, 325, 316, 382, 476, 624, 660, 814, 961, 1331, 1500, 1739, 2140, 2877, 3274, 3939, 4901, 6345, 7448, 9054, 11157, 14315, 17181, 20769, 25843, 32947, 39639, 48257, 60075
Offset: 0

Views

Author

Gus Wiseman, May 11 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
The differences of a sequence are defined as if the sequence were increasing, so for example the differences of (3,1,2) are (-2,1).

Examples

			The a(1) = 1 through a(8) = 20 compositions:
  (1)  (2)   (3)    (4)     (5)      (6)       (7)        (8)
       (11)  (12)   (13)    (14)     (15)      (16)       (17)
             (21)   (22)    (23)     (24)      (25)       (26)
             (111)  (31)    (32)     (33)      (34)       (35)
                    (121)   (41)     (42)      (43)       (44)
                    (1111)  (131)    (51)      (52)       (53)
                            (212)    (123)     (61)       (62)
                            (11111)  (141)     (151)      (71)
                                     (222)     (232)      (161)
                                     (321)     (313)      (242)
                                     (1212)    (12121)    (323)
                                     (2121)    (1111111)  (1232)
                                     (111111)             (1313)
                                                          (2123)
                                                          (2222)
                                                          (2321)
                                                          (3131)
                                                          (3212)
                                                          (21212)
                                                          (11111111)
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],SameQ@@Abs[Differences[#]]&]],{n,0,15}]
  • PARI
    step(R,n,s)={matrix(n, n, i, j, if(i>j, if(j>s, R[i-j, j-s]) + if(j+s<=n, R[i-j, j+s])) )}
    w(n,s)={my(R=matid(n), t=0); while(R, R=step(R,n,s); t+=vecsum(R[n,])); t}
    a(n) = {numdiv(max(1,n)) + sum(s=1, n-1, w(n,s))} \\ Andrew Howroyd, Aug 22 2019

Extensions

a(26)-a(42) from Lars Blomberg, May 30 2019
Terms a(43) and beyond from Andrew Howroyd, Aug 22 2019

A070211 Number of compositions (ordered partitions) of n that are concave-down sequences.

Original entry on oeis.org

1, 1, 2, 4, 6, 9, 14, 18, 24, 34, 42, 52, 68, 82, 101, 126, 147, 175, 213, 246, 289, 344, 392, 453, 530, 598, 687, 791, 885, 1007, 1151, 1276, 1438, 1629, 1806, 2018, 2262, 2490, 2775, 3091, 3387, 3754, 4165, 4542, 5011, 5527, 6012, 6600, 7245, 7864, 8614
Offset: 0

Views

Author

Pontus von Brömssen, May 07 2002

Keywords

Comments

Here, a finite sequence is concave if each term (other than the first or last) is at least the average of the two adjacent terms. - Eric M. Schmidt, Sep 29 2013
The differences of a sequence are defined as if the sequence were increasing, so for example the differences of (3,1,2) are (-2,1). Then a(n) is the number of compositions of n with weakly decreasing differences. - Gus Wiseman, May 15 2019

Examples

			Out of the 8 ordered partitions of 4, only 2+1+1 and 1+1+2 are not concave, so a(4)=6.
From _Gus Wiseman_, May 15 2019: (Start)
The a(1) = 1 through a(6) = 14 compositions:
  (1)  (2)   (3)    (4)     (5)      (6)
       (11)  (12)   (13)    (14)     (15)
             (21)   (22)    (23)     (24)
             (111)  (31)    (32)     (33)
                    (121)   (41)     (42)
                    (1111)  (122)    (51)
                            (131)    (123)
                            (221)    (132)
                            (11111)  (141)
                                     (222)
                                     (231)
                                     (321)
                                     (1221)
                                     (111111)
(End)
		

Crossrefs

Cf. A000079, A001523 (weakly unimodal compositions), A069916, A175342, A320466, A325361 (concave-down partitions), A325545, A325546 (concave-up compositions), A325547, A325548, A325557.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],GreaterEqual@@Differences[#]&]],{n,0,15}] (* Gus Wiseman, May 15 2019 *)
  • Sage
    def A070211(n) : return sum(all(2*p[i] >= p[i-1] + p[i+1] for i in range(1, len(p)-1)) for p in Compositions(n)) # Eric M. Schmidt, Sep 29 2013

Extensions

Name edited by Gus Wiseman, May 15 2019

A325547 Number of compositions of n with strictly increasing differences.

Original entry on oeis.org

1, 1, 2, 3, 6, 8, 11, 18, 24, 30, 45, 57, 71, 96, 120, 148, 192, 235, 286, 354, 431, 518, 628, 752, 893, 1063, 1262, 1482, 1744, 2046, 2386, 2775, 3231, 3733, 4305, 4977, 5715, 6536, 7507, 8559, 9735, 11112, 12608, 14252, 16177, 18265, 20553, 23204, 26090, 29223
Offset: 0

Views

Author

Gus Wiseman, May 10 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
The differences of a sequence are defined as if the sequence were increasing, so for example the differences of (3,1,2) are (-2,1).

Examples

			The a(1) = 1 through a(6) = 11 compositions:
  (1)  (2)   (3)   (4)    (5)    (6)
       (11)  (12)  (13)   (14)   (15)
             (21)  (22)   (23)   (24)
                   (31)   (32)   (33)
                   (112)  (41)   (42)
                   (211)  (113)  (51)
                          (212)  (114)
                          (311)  (213)
                                 (312)
                                 (411)
                                 (2112)
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Less@@Differences[#]&]],{n,0,15}]
  • PARI
    \\ Row sums of R(n) give A179269 (breakdown by width)
    R(n)={my(L=List(), v=vectorv(n, i, 1), w=1, t=1); while(v, listput(L,v); w++; t+=w; v=vectorv(n, i, sum(k=1, (i-1)\t, v[i-k*t]))); Mat(L)}
    seq(n)={my(M=R(n)); Vec(1 + sum(i=1, n, my(p=sum(w=1, min(#M,n\i), x^(w*i)*sum(j=1, n-i*w, x^j*M[j,w])));  x^i*(1 + x^i)*(1 + p + O(x*x^(n-i)))^2))} \\ Andrew Howroyd, Aug 27 2019

Extensions

a(26)-a(42) from Lars Blomberg, May 30 2019
Terms a(43) and beyond from Andrew Howroyd, Aug 27 2019

A325548 Number of compositions of n with strictly decreasing differences.

Original entry on oeis.org

1, 1, 2, 3, 5, 8, 10, 13, 19, 23, 29, 38, 46, 55, 69, 80, 96, 115, 132, 154, 183, 207, 238, 276, 314, 356, 405, 455, 513, 579, 647, 724, 809, 897, 998, 1107, 1225, 1350, 1486, 1639, 1805, 1973, 2166, 2374, 2586, 2824, 3084, 3346, 3646, 3964, 4286, 4655, 5047
Offset: 0

Views

Author

Gus Wiseman, May 10 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
The differences of a sequence are defined as if the sequence were increasing, so for example the differences of (3,1,2) are (-2,1).

Examples

			The a(1) = 1 through a(8) = 19 compositions:
  (1)  (2)   (3)   (4)    (5)    (6)     (7)    (8)
       (11)  (12)  (13)   (14)   (15)    (16)   (17)
             (21)  (22)   (23)   (24)    (25)   (26)
                   (31)   (32)   (33)    (34)   (35)
                   (121)  (41)   (42)    (43)   (44)
                          (122)  (51)    (52)   (53)
                          (131)  (132)   (61)   (62)
                          (221)  (141)   (133)  (71)
                                 (231)   (142)  (134)
                                 (1221)  (151)  (143)
                                         (232)  (152)
                                         (241)  (161)
                                         (331)  (233)
                                                (242)
                                                (251)
                                                (332)
                                                (341)
                                                (431)
                                                (1331)
		

Crossrefs

Programs

  • Maple
    b:= proc(n, l, d) option remember; `if`(n=0, 1, add(`if`(l=0 or
           j-l b(n, 0$2):
    seq(a(n), n=0..52);  # Alois P. Heinz, Jan 27 2024
  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Greater@@Differences[#]&]],{n,0,15}]

Extensions

a(26)-a(44) from Lars Blomberg, May 30 2019
a(45)-a(52) from Alois P. Heinz, Jan 27 2024

A068322 Number of arithmetic progressions of positive odd integers, strictly increasing with sum n.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 1, 2, 2, 2, 1, 3, 1, 3, 3, 5, 1, 4, 1, 5, 4, 5, 1, 7, 2, 6, 5, 8, 1, 7, 1, 9, 6, 8, 2, 11, 1, 9, 7, 12, 1, 10, 1, 12, 10, 11, 1, 15, 2, 12, 9, 15, 1, 13, 3, 16, 10, 14, 1, 18, 1, 15, 12, 20, 4, 17, 1, 19, 12, 17, 1, 22, 1, 18, 16, 22, 2, 20, 1, 24, 15, 20, 1, 25, 5, 21, 15, 26
Offset: 1

Views

Author

Naohiro Nomoto, Feb 27 2002

Keywords

Examples

			From _Petros Hadjicostas_, Sep 29 2019: (Start)
a(12) = 3 because we have the following arithmetic progressions of odd numbers, strictly increasing with sum n=12: 1+11, 3+9, and 5+7.
a(13) = 1 because we have only the following arithmetic progressions of odd numbers, strictly increasing with sum n=13: 13.
a(14) = 3 because we have the following arithmetic progressions of odd numbers, strictly increasing with sum n=14: 1+13, 3+11, and 5+9.
a(15) = 3 because we have the following arithmetic progressions of odd numbers, strictly increasing with sum n=15: 15, 3+5+7, and 1+5+9.
(End)
		

Crossrefs

Formula

From Petros Hadjicostas, Oct 01 2019: (Start)
a(n) = A068324(n) - A001227(n) + (1/2) * (1 - (-1)^n).
G.f.: x/(1 - x^2) + Sum_{m >= 2} x^(m^2)/((1 - x^(2*m)) * (1 - x^(m*(m-1)))).
(End)

A342492 Number of compositions of n with weakly increasing first quotients.

Original entry on oeis.org

1, 1, 2, 4, 7, 11, 17, 26, 37, 52, 73, 95, 125, 163, 208, 261, 330, 407, 498, 607, 734, 881, 1056, 1250, 1480, 1738, 2029, 2359, 2742, 3160, 3635, 4169, 4760, 5414, 6151, 6957, 7861, 8858, 9952, 11148, 12483, 13934, 15526, 17267, 19173, 21252, 23535, 25991
Offset: 0

Views

Author

Gus Wiseman, Mar 16 2021

Keywords

Comments

Also called log-concave-up compositions.
The first quotients of a sequence are defined as if the sequence were an increasing divisor chain, so for example the first quotients of (6,3,1) are (1/2,1/3).

Examples

			The composition (4,2,1,2,3) has first quotients (1/2,1/2,2,3/2) so is not counted under a(12), even though the first differences (-2,-1,1,1) are weakly increasing.
The a(1) = 1 through a(6) = 17 compositions:
  (1)  (2)    (3)      (4)        (5)          (6)
       (1,1)  (1,2)    (1,3)      (1,4)        (1,5)
              (2,1)    (2,2)      (2,3)        (2,4)
              (1,1,1)  (3,1)      (3,2)        (3,3)
                       (1,1,2)    (4,1)        (4,2)
                       (2,1,1)    (1,1,3)      (5,1)
                       (1,1,1,1)  (2,1,2)      (1,1,4)
                                  (3,1,1)      (2,1,3)
                                  (1,1,1,2)    (2,2,2)
                                  (2,1,1,1)    (3,1,2)
                                  (1,1,1,1,1)  (4,1,1)
                                               (1,1,1,3)
                                               (2,1,1,2)
                                               (3,1,1,1)
                                               (1,1,1,1,2)
                                               (2,1,1,1,1)
                                               (1,1,1,1,1,1)
		

Crossrefs

The weakly decreasing version is A069916.
The version for differences instead of quotients is A325546.
The strictly increasing version is A342493.
The unordered version is A342497, ranked by A342523.
The strict unordered version is A342516.
A000005 counts constant compositions.
A000009 counts strictly increasing (or strictly decreasing) compositions.
A000041 counts weakly increasing (or weakly decreasing) compositions.
A000929 counts partitions with all adjacent parts x >= 2y.
A001055 counts factorizations.
A002843 counts compositions with all adjacent parts x <= 2y.
A003238 counts chains of divisors summing to n - 1 (strict: A122651).
A074206 counts ordered factorizations.
A167865 counts strict chains of divisors > 1 summing to n.

Programs

  • Maple
    b:= proc(n, q, l) option remember; `if`(n=0, 1, add(
         `if`(q=0 or q>=l/j, b(n-j, l/j, j), 0), j=1..n))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..50);  # Alois P. Heinz, Mar 25 2021
  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],LessEqual@@Divide@@@Reverse/@Partition[#,2,1]&]],{n,0,15}]
    (* Second program: *)
    b[n_, q_, l_] := b[n, q, l] = If[n == 0, 1, Sum[
         If[q == 0 || q >= l/j, b[n - j, l/j, j], 0], {j, 1, n}]];
    a[n_] := b[n, 0, 0];
    a /@ Range[0, 50] (* Jean-François Alcover, May 19 2021, after Alois P. Heinz *)

Extensions

a(21)-a(47) from Alois P. Heinz, Mar 25 2021

A342532 Number of even-length compositions of n with alternating parts distinct.

Original entry on oeis.org

1, 0, 1, 2, 3, 4, 9, 14, 28, 44, 83, 136, 250, 424, 757, 1310, 2313, 4018, 7081, 12314, 21650, 37786, 66264, 115802, 202950, 354858, 621525, 1087252, 1903668, 3330882, 5831192, 10204250, 17862232, 31260222, 54716913, 95762576, 167614445, 293356422, 513456686
Offset: 0

Views

Author

Gus Wiseman, Mar 28 2021

Keywords

Comments

These are finite even-length sequences q of positive integers summing to n such that q(i) != q(i+2) for all possible i.

Examples

			The a(2) = 1 through a(7) = 14 compositions:
  (1,1)  (1,2)  (1,3)  (1,4)  (1,5)      (1,6)
         (2,1)  (2,2)  (2,3)  (2,4)      (2,5)
                (3,1)  (3,2)  (3,3)      (3,4)
                       (4,1)  (4,2)      (4,3)
                              (5,1)      (5,2)
                              (1,1,2,2)  (6,1)
                              (1,2,2,1)  (1,1,2,3)
                              (2,1,1,2)  (1,1,3,2)
                              (2,2,1,1)  (1,2,3,1)
                                         (1,3,2,1)
                                         (2,1,1,3)
                                         (2,3,1,1)
                                         (3,1,1,2)
                                         (3,2,1,1)
		

Crossrefs

The strictly decreasing version appears to be A064428 (odd-length: A001522).
The equal version is A065608 (A342527 with odds).
The weakly decreasing version is A114921 (A342528 with odds).
Including odds gives A224958.
A000726 counts partitions with alternating parts unequal.
A325545 counts compositions with distinct first differences.
A342529 counts compositions with distinct first quotients.

Programs

  • Mathematica
    qdq[q_]:=And@@Table[q[[i]]!=q[[i+2]],{i,Length[q]-2}];
    Table[Length[Select[Join@@Permutations/@Select[IntegerPartitions[n],EvenQ[Length[#]]&],qdq]],{n,0,15}]
  • PARI
    \\ here gf gives A106351 as g.f.
    gf(n, y)={1/(1 - sum(k=1, n, (-1)^(k+1)*x^k*y^k/(1-x^k) + O(x*x^n)))}
    seq(n)={my(p=gf(n,y)); Vec(sum(k=0, n\2, polcoef(p,k,y)^2))} \\ Andrew Howroyd, Apr 16 2021

Formula

G.f.: 1 + Sum_{k>=1} B_k(x)^2 where B_k(x) is the g.f. of column k of A106351. - Andrew Howroyd, Apr 16 2021

Extensions

Terms a(24) and beyond from Andrew Howroyd, Apr 16 2021
Showing 1-10 of 12 results. Next