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

A338860 The excess of the number of partitions of n with more odd parts than even parts over the number of partitions of n with more even parts than odd parts.

Original entry on oeis.org

0, 1, 0, 2, 1, 3, 4, 6, 8, 11, 17, 21, 30, 38, 53, 68, 90, 115, 150, 192, 243, 312, 390, 496, 613, 775, 951, 1193, 1456, 1810, 2200, 2715, 3285, 4026, 4856, 5909, 7106, 8595, 10301, 12394, 14809, 17728, 21118, 25171, 29891, 35489, 42018, 49702, 58678, 69180
Offset: 0

Views

Author

Jeremy Lovejoy, Jan 12 2021

Keywords

Examples

			The 3 partitions of 4 with more odd parts than even parts are [3,1], [2,1,1], and [1,1,1,1], while the 2 partitions of 4 with more even parts than odd parts are [4] and [2,2].   Hence a(4) = 3-2 = 1.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, signum(t), `if`(i<1, 0,
          b(n, i-1, t)+ b(n-i, min(n-i, i), t+(2*irem(i, 2)-1))))
        end:
    a:= n-> b(n$2, 0):
    seq(a(n), n=0..55);  # Alois P. Heinz, Jan 14 2021
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0, Sign[t], If[i < 1, 0,
       b[n, i-1, t] + b[n-i, Min[n-i, i], t + (2*Mod[i, 2]-1)]]];
    a[n_] := b[n, n, 0];
    Table[a[n], {n, 0, 55}] (* Jean-François Alcover, Sep 09 2022, after Alois P. Heinz *)
  • PARI
    for(n=0,43,my(me=0,mo=0);forpart(v=n,my(x=Vec(v),se=sum(k=1,#x,x[k]%2==0),so=sum(k=1,#x,x[k]%2>0));me+=(se>so);mo+=(so>se));print1(mo-me,", ")) \\ Hugo Pfoertner, Jan 13 2021

Formula

G.f.: (Product_{k>=1} 1/(1-x^(2*k-1)))*Sum_{n>=1} q^(2*n^2-n)*(1-q^n)/Product_{k=1..n} (1-q^(2*k))^2.
a(n) = A108950(n) - A108949(n).

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]&]
Previous Showing 11-12 of 12 results.