%I #22 Jun 02 2019 14:03:49
%S 0,1,0,3,1,5,4,11,8,19,19,35,36,59,65,104,115,168,196,276,321,440,521,
%T 694,821,1072,1277,1644,1957,2477,2959,3705,4411,5472,6516,8014,9524,
%U 11620,13789,16724,19798,23860,28202,33815,39864,47579,55979,66520,78080
%N Number of partitions of n such that the least part occurs with even multiplicity.
%C Also number of partitions of n such that the difference between the two largest distinct parts is even (it is assumed that 0 is a part in each partition). Example: a(6)=5 because we have [6],[5,1],[4,2],[2,2,2] and [3,1,1,1]. - _Emeric Deutsch_, Apr 04 2006
%H Alois P. Heinz, <a href="/A096374/b096374.txt">Table of n, a(n) for n = 1..1000</a>
%F G.f.: Sum_{m>=1} ((x^(2*m)/(1+x^m))/Product_{i>=m}(1-x^i)).
%F a(n) + A096375(n) = A000041(n).
%e a(6) = 5 because we have [4,1,1], [3,3], [2,2,1,1], [2,1,1,1,1] and [1,1,1,1,1,1].
%p g:=sum(x^(2*k)/(1+x^k)/product(1-x^j,j=k..70),k=1..50): gser:=series(g,x=0,50): seq(coeff(gser,x,n),n=1..48); # _Emeric Deutsch_, Apr 04 2006
%p # second Maple program:
%p b:= proc(n, i) option remember; `if`(n=0 or i<1, 0, `if`(irem(n, i, 'r')=0
%p and irem(r, 2)=0, 1, 0)+ add(b(n-i*j, i-1), j=0..n/i))
%p end:
%p a:= n-> b(n, n):
%p seq(a(n), n=1..50); # _Alois P. Heinz_, Feb 27 2013
%t f[n_] := Block[{p = IntegerPartitions[n], l = PartitionsP[n], c = 0, k = 1}, While[k < l + 1, If[ EvenQ[ Count[ p[[k]], p[[k]][[ -1]] ]], c++ ]; k++ ]; c]; Table[ f[n], {n, 50}] (* _Robert G. Wilson v_, Jul 23 2004 *)
%t b[n_, i_] := b[n, i] = If[n == 0 || i < 1, 0, {q, r} = QuotientRemainder[n, i]; If[r == 0 && Mod[q, 2] == 0, 1, 0] + Sum[b[n - i*j, i-1], {j, 0, n/i}]] ; a[n_] := b[n, n]; Table[a[n], {n, 1, 50}] (* _Jean-François Alcover_, Jan 24 2014, after _Alois P. Heinz_ *)
%t Table[Count[IntegerPartitions[n],_?(EvenQ[Length[Split[#][[-1]]]]&)],{n,50}] (* _Harvey P. Dale_, Jun 02 2019 *)
%o (PARI) {q=sum(m=1,100,(x^(2*m)/(1+x^m))/prod(i=m,100,1-x^i,1+O(x^60)), 1+O(x^60));for(n=1,48,print1(polcoeff(q,n),","))} \\ _Klaus Brockhaus_, Jul 21 2004
%Y Cf. A000041, A096375.
%K easy,nonn
%O 1,4
%A _Vladeta Jovovic_, Jul 19 2004
%E Edited and extended by _Robert G. Wilson v_ and _Klaus Brockhaus_, Jul 21 2004