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.

A239240 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 A239240 #16 Aug 30 2016 03:51:19
%S A239240 1,0,1,1,1,2,2,4,2,6,4,9,6,13,10,18,15,24,24,32,35,43,51,56,72,74,100,
%T A239240 97,136,128,183,168,241,222,315,290,408,381,522,497,664,647,839,837,
%U A239240 1054,1081,1317,1384,1641,1767,2035,2242,2519,2831,3108,3555,3828
%N A239240 Number of partitions of n into distinct parts for which (number of odd parts) <= (number of even parts).
%C A239240 a(n) = Sum_{k<=0} A240021(n,k). - _Alois P. Heinz_, Apr 02 2014
%H A239240 Alois P. Heinz, <a href="/A239240/b239240.txt">Table of n, a(n) for n = 0..1000</a>
%F A239240 a(n) + A239242(n) = A000009(n) for n >=1.
%e A239240 a(7) = 4 counts these partitions:  61, 52, 43, 421.
%p A239240 b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2, 0,
%p A239240      `if`(n=0, `if`(t<=0, 1, 0 ), b(n, i-1, t)+`if`(i>n, 0,
%p A239240       b(n-i, i-1, t+`if`(irem(i, 2)=1, 1, -1)))))
%p A239240     end:
%p A239240 a:= n-> b(n$2, 0):
%p A239240 seq(a(n), n=0..60);  # _Alois P. Heinz_, Mar 15 2014
%t A239240 z = 55; p[n_] := p[n] = IntegerPartitions[n]; d[u_] := d[u] = DeleteDuplicates[u]; g[u_] := g[u] = Length[u];
%t A239240 Table[g[Select[Select[p[n], d[#] == # &], Count[#, _?OddQ] < Count[#, _?EvenQ] &]], {n, 0, z}] (* A239239 *)
%t A239240 Table[g[Select[Select[p[n], d[#] == # &], Count[#, _?OddQ] <= Count[#, _?EvenQ] &]], {n, 0, z}] (* A239240 *)
%t A239240 Table[g[Select[Select[p[n], d[#] == # &], Count[#, _?OddQ] == Count[#, _?EvenQ] &]], {n, 0, z}] (* A239241 *)
%t A239240 Table[g[Select[Select[p[n], d[#] == # &], Count[#, _?OddQ] > Count[#, _?EvenQ] &]], {n, 0, z}] (* A239242 *)
%t A239240 Table[g[Select[Select[p[n], d[#] == # &], Count[#, _?OddQ] >= Count[#, _?EvenQ] &]], {n, 0, z}] (* A239243 *)
%t A239240 (* _Peter J. C. Moses_, Mar 10 2014 *)
%t A239240 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_, Aug 30 2016, after _Alois P. Heinz_ *)
%Y A239240 Cf. A239239, A239241, A239242, A239243, A000009.
%K A239240 nonn,easy
%O A239240 0,6
%A A239240 _Clark Kimberling_, Mar 13 2014