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

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

A242626 Number T(n,k) of compositions of n, where k is the difference between the number of odd parts and the number of even parts, both counted without multiplicity; triangle T(n,k), n>=0, read by rows.

Original entry on oeis.org

1, 1, 1, 0, 1, 2, 2, 2, 3, 1, 2, 11, 2, 3, 2, 2, 14, 8, 6, 6, 33, 14, 11, 5, 15, 43, 45, 20, 44, 82, 99, 25, 6, 14, 74, 141, 230, 41, 12, 202, 260, 451, 85, 26, 6, 22, 351, 514, 953, 148, 54, 24, 766, 1049, 1798, 355, 104, 18, 104, 1301, 2321, 3503, 751, 194
Offset: 0

Views

Author

Alois P. Heinz, May 19 2014

Keywords

Comments

T(n^2,n) = T(n^2+n,-n) = n! = A000142(n) for n>=0.

Examples

			T(8,-1) = 15: [2,2,2,2], [1,1,2,4], [1,1,4,2], [1,2,1,4], [1,2,4,1], [1,4,1,2], [1,4,2,1], [2,1,1,4], [2,1,4,1], [2,4,1,1], [4,1,1,2], [4,1,2,1], [4,2,1,1], [4,4], [8].
Triangle T(n,k) begins:
: n\k : -3   -2    -1     0     1    2    3 ...
+-----+------------------------------------
:  0  :                   1;
:  1  :                         1;
:  2  :             1,    0,    1;
:  3  :                   2,    2;
:  4  :             2,    3,    1,   2;
:  5  :                  11,    2,   3;
:  6  :       2,    2,   14,    8,   6;
:  7  :             6,   33,   14,  11;
:  8  :       5,   15,   43,   45,  20;
:  9  :            44,   82,   99,  25,   6;
: 10  :      14,   74,  141,  230,  41,  12;
: 11  :           202,  260,  451,  85,  26;
: 12  :  6,  22,  351,  514,  953, 148,  54;
: 13  :      24,  766, 1049, 1798, 355, 104;
: 14  : 18, 104, 1301, 2321, 3503, 751, 194;
		

Crossrefs

Row sums give A011782.
Cf. A242498 (compositions with multiplicity), A242618 (partitions without multiplicity).

Programs

  • Maple
    b:= proc(n, i, p) option remember; `if`(n=0, p!, `if`(i<1, 0,
          expand(add(`if`(j=0, 1, x^(2*irem(i, 2)-1))*
          b(n-i*j, i-1, p+j)/j!, j=0..n/i))))
        end:
    T:= n->(p->seq(coeff(p, x, i), i=ldegree(p)..degree(p)))(b(n$2, 0)):
    seq(T(n), n=0..20);
  • Mathematica
    b[n_, i_, p_] := b[n, i, p] = If[n==0, p!, If[i<1, 0, Expand[Sum[If[j==0, 1, x^(2*Mod[i, 2]-1)]*b[n-i*j, i-1, p+j]/j!, {j, 0, n/i}]]]]; T[n_] := Function[p, Table[Coefficient[p, x, i], {i, Exponent[p, x, Min], Exponent[p, x]}]][b[n, n, 0]]; Table[T[n], {n, 0, 20}] // Flatten (* Jean-François Alcover, Jan 17 2017, translated from Maple *)

A355321 Numbers k such that the k-th composition in standard order has the same number of even parts as odd.

Original entry on oeis.org

0, 5, 6, 17, 18, 20, 24, 43, 45, 46, 53, 54, 58, 65, 66, 68, 72, 80, 96, 139, 141, 142, 149, 150, 154, 163, 165, 166, 169, 172, 177, 178, 180, 184, 197, 198, 202, 209, 210, 212, 216, 226, 232, 257, 258, 260, 264, 272, 288, 320, 343, 347, 349, 350, 363, 365
Offset: 1

Views

Author

Gus Wiseman, Jun 28 2022

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.

Examples

			The terms together with their corresponding compositions begin:
   0: ()
   5: (2,1)
   6: (1,2)
  17: (4,1)
  18: (3,2)
  20: (2,3)
  24: (1,4)
  43: (2,2,1,1)
  45: (2,1,2,1)
  46: (2,1,1,2)
  53: (1,2,2,1)
  54: (1,2,1,2)
  58: (1,1,2,2)
  65: (6,1)
  66: (5,2)
  68: (4,3)
  72: (3,4)
  80: (2,5)
  96: (1,6)
		

Crossrefs

A subset of A001969 (evil numbers), complement A000069.
These compositions are counted by A098123, without multiplicity A242821.
The version for partitions is A325698, counted by A045931.
For partitions without multiplicity we have A325700, counted by A241638.
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.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],Count[stc[#],?EvenQ]==Count[stc[#],?OddQ]&]
Showing 1-3 of 3 results.