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.

A239241 Number of partitions of n into distinct parts for which (number of odd parts) = (number of even parts).

This page as a plain text file.
%I A239241 #15 Dec 27 2015 09:32:24
%S A239241 1,0,0,1,0,2,0,3,0,4,1,5,2,6,5,7,8,8,14,9,20,11,30,13,40,17,55,23,70,
%T A239241 32,91,45,112,65,140,91,169,128,206,177,245,241,295,323,350,429,419,
%U A239241 559,499,722,600,921,721,1162,874,1452,1062,1800,1299,2210
%N A239241 Number of partitions of n into distinct parts for which (number of odd parts) = (number of even parts).
%C A239241 a(n) = A240021(n,0). - _Alois P. Heinz_, Apr 02 2014
%H A239241 Alois P. Heinz, <a href="/A239241/b239241.txt">Table of n, a(n) for n = 0..1000</a>
%F A239241 a(n) + A239239(n) + A239242(n) = A000009(n) for n >=1.
%F A239241 a(n) = [x^n y^0] Product_{i>=1} 1+x^i*y^(2*(i mod 2)-1). - _Alois P. Heinz_, Apr 03 2014
%e A239241 a(9) = 4 counts these partitions:  81, 72, 63, 54.
%p A239241 b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2, 0,
%p A239241      `if`(n=0, `if`(t=0, 1, 0 ), b(n, i-1, t)+`if`(i>n, 0,
%p A239241       b(n-i, i-1, t+`if`(irem(i, 2)=1, 1, -1)))))
%p A239241     end:
%p A239241 a:= n-> b(n$2, 0):
%p A239241 seq(a(n), n=0..60);  # _Alois P. Heinz_, Mar 15 2014
%t A239241 z = 55; p[n_] := p[n] = IntegerPartitions[n]; d[u_] := d[u] = DeleteDuplicates[u]; g[u_] := g[u] = Length[u];
%t A239241 Table[g[Select[Select[p[n], d[#] == # &], Count[#, _?OddQ] < Count[#, _?EvenQ] &]], {n, 0, z}] (* A239239 *)
%t A239241 Table[g[Select[Select[p[n], d[#] == # &], Count[#, _?OddQ] <= Count[#, _?EvenQ] &]], {n, 0, z}] (* A239240 *)
%t A239241 Table[g[Select[Select[p[n], d[#] == # &], Count[#, _?OddQ] == Count[#, _?EvenQ] &]], {n, 0, z}] (* A239241 *)
%t A239241 Table[g[Select[Select[p[n], d[#] == # &], Count[#, _?OddQ] > Count[#, _?EvenQ] &]], {n, 0, z}] (* A239242 *)
%t A239241 Table[g[Select[Select[p[n], d[#] == # &], Count[#, _?OddQ] >= Count[#, _?EvenQ] &]], {n, 0, z}] (* A239243 *)
%t A239241 (* _Peter J. C. Moses_, Mar 10 2014 *)
%t A239241 b[n_, i_, t_] := b[n, i, t] = If[n > i*(i+1)/2, 0, If[n==0, If[t==0, 1, 0], b[n, i-1, t] + If[i>n, 0, b[n-i, i-1, t + If[Mod[i, 2]==1, 1, -1]]]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 0, 60}] (* _Jean-François Alcover_, Dec 27 2015, after _Alois P. Heinz_ *)
%Y A239241 Cf. A239239, A239240, A239242, A239243, A000009.
%K A239241 nonn,easy
%O A239241 0,6
%A A239241 _Clark Kimberling_, Mar 13 2014