OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..2000
B. Kim, E. Kim, and J. Lovejoy, Parity bias in partitions, European J. Combin., 89 (2020), 103159, 19 pp.
FORMULA
EXAMPLE
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.
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Jeremy Lovejoy, Jan 12 2021
STATUS
approved