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.

Previous Showing 11-18 of 18 results.

A156042 A(n,k) for n >= k in triangular ordering, where A(n,k) is the number of compositions (ordered partitions) of n into k parts, with the first part greater than or equal to all other parts.

Original entry on oeis.org

1, 1, 2, 1, 2, 4, 1, 3, 6, 11, 1, 3, 8, 17, 32, 1, 4, 11, 26, 54, 102, 1, 4, 13, 35, 82, 172, 331, 1, 5, 17, 48, 120, 272, 567, 1101, 1, 5, 20, 63, 170, 412, 918, 1906, 3724, 1, 6, 24, 81, 235, 607, 1434, 3152, 6518, 12782, 1, 6, 28, 102, 317, 872, 2180, 5049, 10978, 22616, 44444
Offset: 1

Views

Author

Jack W Grahl, Feb 02 2009

Keywords

Comments

The value is smaller than the number of compositions (ordered partitions) of n into k parts and at least the number of (unordered) partitions.

Examples

			A(5,3) = 8 and the 8 compositions of 5 into 3 parts with first part maximal are:
[5,0,0], [4,1,0], [4,0,1], [3,2,0], [3,0,2], [3,1,1], [2,2,1], [2,1,2].
1
1  2
1  2  4
1  3  6  11
1  3  8  17  32
1  4  11 26  54  102
		

Crossrefs

A156041 is the whole of the square. A156043 is the diagonal. See also A156039 and A156040.

Programs

  • Maple
    b:= proc(n,i,m) option remember;
          if n<0 then 0
        elif n=0 then 1
        elif i=1 then `if`(n<=m, 1, 0)
        else add(b(n-k, i-1, m), k=0..m)
          fi
        end:
    A:= (n,k)-> add(b(n-m, k-1, m), m=ceil(n/k)..n):
    seq(seq(A(n,k), k=1..n), n=1..12); # Alois P. Heinz, Jun 14 2009
  • Mathematica
    nn=10; Table[Table[Coefficient[Series[Sum[x^i((1-x^(i+1))/(1-x))^(k-1), {i, 0, n}], {x, 0, nn}], x^n], {k, 1, n}], {n, 1, nn}]//Grid (* Geoffrey Critzer, Jul 15 2013 *)

Extensions

More terms from Alois P. Heinz, Jun 14 2009

A156043 A(n,n), where A(n,k) is the number of compositions (ordered partitions) of n into k parts (parts of size 0 being allowed), with the first part being greater than or equal to all the rest.

Original entry on oeis.org

1, 2, 4, 11, 32, 102, 331, 1101, 3724, 12782, 44444, 156334, 555531, 1991784, 7197369, 26186491, 95847772, 352670170, 1303661995, 4838822931, 18025920971, 67371021603, 252538273442, 949164364575, 3576145084531, 13503991775252
Offset: 1

Views

Author

Jack W Grahl, Feb 02 2009

Keywords

Comments

The value is smaller than the number of compositions of n into k parts and at least the number of (unordered) partitions.
It is also at least the number of compositions of n into n parts divided by n. From these bounds: C(2*n-1,n-1)/n <= a(n) <= C(2*n-1,n-1). - Robert Gerbicz, Apr 06 2011
a(n) is also the number of Dyck paths of semilength 2n such that each level has exactly n peaks or no peaks. a(3) = 4: //\\//\\//\\, ///\\//\/\\\, ///\/\\//\\\, ////\/\/\\\\. - Alois P. Heinz, Jun 04 2017

Examples

			a(4) = 11: the 11 compositions of this type of 4 into 4 parts being
(4,0,0,0); (3,1,0,0); (3,0,1,0); (3,0,0,1);
(2,2,0,0); (2,0,2,0); (2,0,0,2); (2,1,1,0);
(2,1,0,1); (2,0,1,1); (1,1,1,1)
		

Crossrefs

A156041 gives the full array A(n, k). See also A156039, A156040 and A156042.
One of two bisections of A188624 (see also A188625).

Programs

  • Maple
    b:= proc(n,i,m) option remember; if n<0 then 0 elif n=0 then 1 elif i=1 then `if`(n<=m, 1, 0) else add(b(n-k, i-1, m), k=0..m) fi end: A:= (n,k)-> add(b(n-m, k-1, m), m=ceil(n/k)..n): seq(A(n,n), n=1..30); # Alois P. Heinz, Jun 14 2009
  • Mathematica
    b[n_, i_, m_] := b[n, i, m] = Which[n<0, 0, n==0, 1, i==1, If[n <= m, 1, 0], True, Sum[b[n-k, i-1, m], {k, 0, m}]]; A[n_, k_] := Sum[b[n-m, k-1, m], {m, Ceiling[n/k], n}]; Table[A[n, n], {n, 1, 30}] (* Jean-François Alcover, Jul 15 2015, after Alois P. Heinz *)
  • PARI
    N=120;v=vector(N,i,0);for(d=1,N,A=matrix(N,N,i,j,0);A[1,1]=1; for(i=1,N-1,for(j=0,N-1,s=0;for(k=0,min(j,d), s+=A[i,j-k+1]);A[i+1,j+1]=s)); for(i=d,N,v[i]+=A[i,i-d+1]));for(i=1,N,print1(v[i]", ")) \\ Robert Gerbicz, Apr 06 2011

Extensions

More terms from Alois P. Heinz, Jun 14 2009
Edited by N. J. A. Sloane, Apr 06 2011

A184957 Triangle read by rows: T(n,k) (n >= 1, 1 <= k <= n) is the number of compositions of n into k parts the first of which is >= all the other parts.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 3, 1, 1, 1, 3, 4, 4, 1, 1, 1, 3, 6, 7, 5, 1, 1, 1, 4, 8, 11, 11, 6, 1, 1, 1, 4, 11, 17, 19, 16, 7, 1, 1, 1, 5, 13, 26, 32, 31, 22, 8, 1, 1, 1, 5, 17, 35, 54, 56, 48, 29, 9, 1, 1, 1, 6, 20, 48, 82, 102, 93, 71, 37, 10, 1, 1, 1, 6, 24, 63, 120, 172, 180, 148, 101, 46, 11, 1, 1, 1, 7, 28, 81, 170, 272, 331, 302, 227, 139, 56, 12, 1, 1
Offset: 1

Views

Author

N. J. A. Sloane, Feb 27 2011

Keywords

Comments

If the final diagonal is omitted, this gives the triangular array visible in A156041 and A186807.

Examples

			Triangle begins:
  [1],
  [1, 1],
  [1, 1, 1],
  [1, 2, 1, 1],
  [1, 2, 3, 1, 1],
  [1, 3, 4, 4, 1, 1],
  [1, 3, 6, 7, 5, 1, 1],
  [1, 4, 8, 11, 11, 6, 1, 1],
  [1, 4, 11, 17, 19, 16, 7, 1, 1],
  [1, 5, 13, 26, 32, 31, 22, 8, 1, 1],
  [1, 5, 17, 35, 54, 56, 48, 29, 9, 1, 1],
  ...
		

Crossrefs

Cf. A156040, A156041, A186807, A079500 (row sums).

Programs

  • Maple
    # The following Maple program is a modification of Alois P. Heinz's program for A156041
    b:= proc(n, i, m) option remember;
           if n<0 then 0 elif n=0 then 1 elif i=1 then
          `if`(n<=m, 1, 0) else add(b(n-k, i-1, m), k=0..m) fi
        end:
    A:= (n, k)-> add(b(n-m, k-1, m), m=ceil(n/k)..n):
    [seq([seq(A(d-k, k), k=1..d)], d=1..14)];
  • Mathematica
    Map[Select[#,#>0&]&,Drop[nn=11;CoefficientList[Series[Sum[x^i/(1-y(x-x^(i+1))/(1-x)),{i,1,nn}],{x,0,nn}],{x,y}],1]]//Grid (* Geoffrey Critzer, Jul 15 2013 *)

Formula

T(n,k) = A156041(n-k,k).
O.g.f.: Sum_{i>=1} x^i/(1 - y*(x - x^(i+1))/(1-x)). - Geoffrey Critzer, Jul 15 2013

A321773 Number of compositions of n into parts with distinct multiplicities and with exactly three parts.

Original entry on oeis.org

1, 3, 6, 4, 9, 9, 10, 12, 15, 13, 18, 18, 19, 21, 24, 22, 27, 27, 28, 30, 33, 31, 36, 36, 37, 39, 42, 40, 45, 45, 46, 48, 51, 49, 54, 54, 55, 57, 60, 58, 63, 63, 64, 66, 69, 67, 72, 72, 73, 75, 78, 76, 81, 81, 82, 84, 87, 85, 90, 90, 91, 93, 96, 94, 99, 99
Offset: 3

Views

Author

Alois P. Heinz, Nov 18 2018

Keywords

Examples

			From _Gus Wiseman_, Nov 11 2020: (Start)
Also the number of 3-part non-strict compositions of n. For example, the a(3) = 1 through a(11) = 15 triples are:
  111   112   113   114   115   116   117   118   119
        121   122   141   133   161   144   181   155
        211   131   222   151   224   171   226   191
              212   411   223   233   225   244   227
              221         232   242   252   262   272
              311         313   323   333   334   335
                          322   332   414   343   344
                          331   422   441   424   353
                          511   611   522   433   434
                                      711   442   443
                                            622   515
                                            811   533
                                                  551
                                                  722
                                                  911
(End)
		

Crossrefs

Column k=3 of A242887.
A235451 counts 3-part compositions with distinct run-lengths
A001399(n-6) counts 3-part compositions in the complement.
A014311 intersected with A335488 ranks these compositions.
A140106 is the unordered case, with Heinz numbers A285508.
A261982 counts non-strict compositions of any length.
A001523 counts unimodal compositions, with complement A115981.
A007318 and A097805 count compositions by length.
A032020 counts strict compositions.
A047967 counts non-strict partitions, with Heinz numbers A013929.
A242771 counts triples that are not strictly increasing.

Programs

  • Mathematica
    Table[Length[Join@@Permutations/@Select[IntegerPartitions[n,{3}],!UnsameQ@@#&]],{n,0,100}] (* Gus Wiseman, Nov 11 2020 *)

Formula

Conjectures from Colin Barker, Dec 11 2018: (Start)
G.f.: x^3*(1 + 3*x + 5*x^2) / ((1 - x)^2*(1 + x)*(1 + x + x^2)).
a(n) = a(n-2) + a(n-3) - a(n-5) for n>7. (End)
Conjecture: a(n) = (3*n-k)/2 where k value has a cycle of 6 starting from n=3 of (7,6,3,10,3,6). - Bill McEachen, Aug 12 2025

A242771 Number of integer points in a certain quadrilateral scaled by a factor of n (another version).

Original entry on oeis.org

0, 0, 1, 3, 6, 9, 14, 19, 25, 32, 40, 48, 58, 68, 79, 91, 104, 117, 132, 147, 163, 180, 198, 216, 236, 256, 277, 299, 322, 345, 370, 395, 421, 448, 476, 504, 534, 564, 595, 627, 660, 693, 728, 763, 799, 836, 874, 912, 952, 992, 1033, 1075, 1118, 1161, 1206
Offset: 1

Views

Author

Michael Somos, May 22 2014

Keywords

Comments

The quadrilateral is given by four vertices [(1/2, 1/3), (0, 1), (0, 0), (1, 0)] as an example on page 22 of Ehrhart 1967. Here the open line segment from (1/2, 1/3) to (0, 1) is included but the rest of the boundary is not. The sequence is denoted by d'(n).
From Gus Wiseman, Oct 18 2020: (Start)
Also the number of ordered triples of positive integers summing to n that are not strictly increasing. For example, the a(3) = 1 through a(7) = 14 triples are:
(1,1,1) (1,1,2) (1,1,3) (1,1,4) (1,1,5)
(1,2,1) (1,2,2) (1,3,2) (1,3,3)
(2,1,1) (1,3,1) (1,4,1) (1,4,2)
(2,1,2) (2,1,3) (1,5,1)
(2,2,1) (2,2,2) (2,1,4)
(3,1,1) (2,3,1) (2,2,3)
(3,1,2) (2,3,2)
(3,2,1) (2,4,1)
(4,1,1) (3,1,3)
(3,2,2)
(3,3,1)
(4,1,2)
(4,2,1)
(5,1,1)
A001399(n-6) counts the complement (unordered strict triples).
A014311 \ A333255 ranks these compositions.
A140106 is the unordered version.
A337484 is the case not strictly decreasing either.
A337698 counts these compositions of any length, with complement A000009.
A001399(n-6) counts unordered strict triples.
A001523 counts unimodal compositions, with complement A115981.
A007318 and A097805 count compositions by length.
A069905 counts unordered triples.
A218004 counts strictly increasing or weakly decreasing compositions.
A337483 counts triples either weakly increasing or weakly decreasing.
(End)

Examples

			G.f. = x^3 + 3*x^4 + 6*x^5 + 9*x^6 + 14*x^7 + 19*x^8 + 25*x^9 + 32*x^10 + ...
		

Crossrefs

Programs

  • Magma
    [Floor((5*n-7)*(n-1)/12): n in [1..60]]; // Vincenzo Librandi, Jun 27 2015
  • Mathematica
    a[ n_] := Quotient[ 7 - 12 n + 5 n^2, 12];
    a[ n_] := With[ {o = Boole[ 0 < n], c = Boole[ 0 >= n], m = Abs@n}, Length @ FindInstance[ 0 < c + x && 0 < c + y && (2 x < c + m && 4 x + 3 y < o + 3 m || m < o + 2 x && 2 x + 3 y < c + 2 m), {x, y}, Integers, 10^9]];
    LinearRecurrence[{1,1,0,-1,-1,1},{0,0,1,3,6,9},90] (* Harvey P. Dale, May 28 2015 *)
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{3}],!Less@@#&]],{n,0,15}] (* Gus Wiseman, Oct 18 2020 *)
  • PARI
    {a(n) = (7 - 12*n + 5*n^2) \ 12};
    
  • PARI
    {a(n) = if( n<0, polcoeff( x * (2 + x^2 + x^3 + x^4) / ((1 - x)^2 * (1 - x^6)) + x * O(x^-n), -n), polcoeff( x^3 * (1 + x + x^2 + 2*x^4) / ((1 - x)^2 * (1 - x^6)) + x * O(x^n), n))};
    

Formula

G.f.: x^3 * (1 + 2*x + 2*x^2) / (1 - x - x^2 + x^4 + x^5 - x^6) = (x^3 + x^4 + x^5 + 2*x^7) / ((1 - x)^2 * (1 - x^6)).
a(n) = floor( A147874(n) / 12).
a(-n) = A002789(n).
a(n+1) - a(n) = A010761(n).
For n >= 6, a(n) = A000217(n-2) - A001399(n-6). - Gus Wiseman, Oct 18 2020

A337459 Numbers k such that the k-th composition in standard order is a unimodal triple.

Original entry on oeis.org

7, 11, 13, 14, 19, 21, 25, 26, 28, 35, 37, 41, 42, 49, 50, 52, 56, 67, 69, 73, 74, 81, 82, 84, 97, 98, 100, 104, 112, 131, 133, 137, 138, 145, 146, 161, 162, 164, 168, 193, 194, 196, 200, 208, 224, 259, 261, 265, 266, 273, 274, 289, 290, 292, 321, 322, 324
Offset: 1

Views

Author

Gus Wiseman, Sep 07 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
A sequence of integers is unimodal if it is the concatenation of a weakly increasing and a weakly decreasing sequence.
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.

Examples

			The sequence together with the corresponding triples begins:
      7: (1,1,1)     52: (1,2,3)    133: (5,2,1)
     11: (2,1,1)     56: (1,1,4)    137: (4,3,1)
     13: (1,2,1)     67: (5,1,1)    138: (4,2,2)
     14: (1,1,2)     69: (4,2,1)    145: (3,4,1)
     19: (3,1,1)     73: (3,3,1)    146: (3,3,2)
     21: (2,2,1)     74: (3,2,2)    161: (2,5,1)
     25: (1,3,1)     81: (2,4,1)    162: (2,4,2)
     26: (1,2,2)     82: (2,3,2)    164: (2,3,3)
     28: (1,1,3)     84: (2,2,3)    168: (2,2,4)
     35: (4,1,1)     97: (1,5,1)    193: (1,6,1)
     37: (3,2,1)     98: (1,4,2)    194: (1,5,2)
     41: (2,3,1)    100: (1,3,3)    196: (1,4,3)
     42: (2,2,2)    104: (1,2,4)    200: (1,3,4)
     49: (1,4,1)    112: (1,1,5)    208: (1,2,5)
     50: (1,3,2)    131: (6,1,1)    224: (1,1,6)
		

Crossrefs

A337460 is the non-unimodal version.
A000217(n - 2) counts 3-part compositions.
6*A001399(n - 6) = 6*A069905(n - 3) = 6*A211540(n - 1) counts strict 3-part compositions.
A001399(n - 3) = A069905(n) = A211540(n + 2) counts 3-part partitions.
A001399(n - 6) = A069905(n - 3) = A211540(n - 1) counts strict 3-part partitions.
A001523 counts unimodal compositions.
A007052 counts unimodal patterns.
A011782 counts unimodal permutations.
A115981 counts non-unimodal compositions.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Triples are A014311, with strict case A337453.
- Sum is A070939.
- Runs are counted by A124767.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Heinz number is A333219.
- Combinatory separations are counted by A334030.
- Non-unimodal compositions are A335373.
- Non-co-unimodal compositions are A335374.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,1000],Length[stc[#]]==3&&!MatchQ[stc[#],{x_,y_,z_}/;x>y
    				

Formula

Complement of A335373 in A014311.

A337460 Numbers k such that the k-th composition in standard order is a non-unimodal triple.

Original entry on oeis.org

22, 38, 44, 70, 76, 88, 134, 140, 148, 152, 176, 262, 268, 276, 280, 296, 304, 352, 518, 524, 532, 536, 552, 560, 592, 608, 704, 1030, 1036, 1044, 1048, 1064, 1072, 1096, 1104, 1120, 1184, 1216, 1408, 2054, 2060, 2068, 2072, 2088, 2096, 2120, 2128, 2144, 2192
Offset: 1

Views

Author

Gus Wiseman, Sep 18 2020

Keywords

Comments

These are triples matching the pattern (2,1,2), (3,1,2), or (2,1,3).
A sequence of integers is unimodal if it is the concatenation of a weakly increasing and a weakly decreasing sequence.
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.

Examples

			The sequence together with the corresponding triples begins:
      22: (2,1,2)     296: (3,2,4)    1048: (6,1,4)
      38: (3,1,2)     304: (3,1,5)    1064: (5,2,4)
      44: (2,1,3)     352: (2,1,6)    1072: (5,1,5)
      70: (4,1,2)     518: (7,1,2)    1096: (4,3,4)
      76: (3,1,3)     524: (6,1,3)    1104: (4,2,5)
      88: (2,1,4)     532: (5,2,3)    1120: (4,1,6)
     134: (5,1,2)     536: (5,1,4)    1184: (3,2,6)
     140: (4,1,3)     552: (4,2,4)    1216: (3,1,7)
     148: (3,2,3)     560: (4,1,5)    1408: (2,1,8)
     152: (3,1,4)     592: (3,2,5)    2054: (9,1,2)
     176: (2,1,5)     608: (3,1,6)    2060: (8,1,3)
     262: (6,1,2)     704: (2,1,7)    2068: (7,2,3)
     268: (5,1,3)    1030: (8,1,2)    2072: (7,1,4)
     276: (4,2,3)    1036: (7,1,3)    2088: (6,2,4)
     280: (4,1,4)    1044: (6,2,3)    2096: (6,1,5)
		

Crossrefs

A000212 counts unimodal triples.
A000217(n - 2) counts 3-part compositions.
A001399(n - 3) counts 3-part partitions.
A001399(n - 6) counts 3-part strict partitions.
A001399(n - 6)*2 counts non-unimodal 3-part strict compositions.
A001399(n - 6)*4 counts unimodal 3-part strict compositions.
A001399(n - 6)*6 counts 3-part strict compositions.
A001523 counts unimodal compositions.
A001840 counts non-unimodal triples.
A059204 counts non-unimodal permutations.
A115981 counts non-unimodal compositions.
A328509 counts non-unimodal patterns.
A337459 ranks unimodal triples.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Triples are A014311.
- Sum is A070939.
- Runs are counted by A124767.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Heinz number is A333219.
- Non-unimodal compositions are A335373.
- Non-co-unimodal compositions are A335374.
- Strict triples are A337453.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,1000],Length[stc[#]]==3&&MatchQ[stc[#],{x_,y_,z_}/;x>y
    				

Formula

Intersection of A014311 and A335373.

A051275 Expansion of (1+x^2)/((1-x^2)*(1-x^3)).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Apart from initial term(s), dimension of the space of weight 2n cuspidal newforms for Gamma_0( 12 ).
Diagonal sums of A117567. - Paul Barry, Mar 29 2006
First differences of A156040. - Bob Selcoe, Feb 07 2014
Also first difference of diagonal sums of the triangle formed by rows T(2,k) k=0,1...,2m of ascending m-nomial triangles (see A004737). - Bob Selcoe, Feb 07 2014

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(1+x^2)/((1-x^2)(1-x^3)),{x,0,100}],x] (* or *) LinearRecurrence[{0,1,1,0,-1},{1,0,2,1,2},100] (* Harvey P. Dale, Dec 10 2024 *)
  • PARI
    Vec((1+x^2)/((1-x^2)*(1-x^3))+ O(x^80)) \\ Michel Marcus, Nov 26 2019

Formula

From Paul Barry, Mar 29 2006: (Start)
a(n) = a(n-2) + a(n-3) - a(n-5);
a(n) = cos(2*Pi*n/3 + Pi/3)/3 - sqrt(3)*sin(2*Pi*n/3 + Pi/3)/9 + (-1)^n/2 + (2n+3)/6;
a(n) = Sum_{k=0..floor(n/2)} F(L((n-2k+2)/3)) where L(j/p) is the Legendre symbol of j and p. (End)
a(n) = 2*floor(n/2) + floor((n+4)/3) - n. - Ridouane Oudra, Nov 26 2019
Previous Showing 11-18 of 18 results.