Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #64 Aug 06 2022 07:18:24
%S 1,1,0,2,0,2,1,3,1,3,3,4,4,4,6,6,8,6,12,8,14,10,19,13,23,16,29,21,35,
%T 26,43,34,50,43,61,54,72,67,85,84,100,103,119,126,138,155,163,186,191,
%U 224,224,268,263,319,308,378,360,447,422,523,494,614,576,716,674,833,787,964,917,1118
%N Odd-even partitions: number of partitions into distinct parts where all differences between consecutive parts are odd and the minimal part is odd.
%C Parts are odd, even, odd, even, ... [_Joerg Arndt_, Oct 27 2012]
%H Alois P. Heinz, <a href="/A179049/b179049.txt">Table of n, a(n) for n = 0..10000</a>
%H G. E. Andrews, <a href="https://doi.org/10.1016/0001-8708(84)90017-3">Ramanujan’s “lost” notebook. IV. Stacks and alternating parity in partitions</a>, Adv. in Math. 53 (1984), no. 1, 55-74.
%H Min-Joo Jang, <a href="https://arxiv.org/abs/1703.01837">Asymptotic behavior of odd-even partitions</a>, arXiv:1703.01837v1 [math.NT], 2017.
%F G.f.: Sum_{n>=0} x^(n*(n+1)/2) / Product_{k=1..n} (1 - x^(2*k)).
%F a(n) ~ (1/(2*sqrt(5)*n^(3/4)))*exp(Pi*sqrt(n/5)) [Jang 2017]. - _Peter Bala_, Mar 28 2017
%e From _Joerg Arndt_, Oct 27 2012: (Start)
%e The a(20) = 14 such partitions of 20 are:
%e [ 1] 1 2 3 14
%e [ 2] 1 2 5 12
%e [ 3] 1 2 7 10
%e [ 4] 1 2 17
%e [ 5] 1 4 5 10
%e [ 6] 1 4 7 8
%e [ 7] 1 4 15
%e [ 8] 1 6 13
%e [ 9] 1 8 11
%e [10] 3 4 5 8
%e [11] 3 4 13
%e [12] 3 6 11
%e [13] 3 8 9
%e [14] 5 6 9
%e (End)
%p b:= proc(n, i) option remember; `if`(n=0, 1,
%p `if`(i>n, 0, b(n, i+2)+b(n-i, i+1)))
%p end:
%p a:= n-> b(n, 1):
%p seq(a(n), n=0..100); # _Alois P. Heinz_, Nov 08 2012; revised Feb 24 2020
%t b[n_, i_, t_] := b[n, i, t] = If[n==0, Mod[t, 2], If[i<1, 0, b[n, i-1, t] + If[i <= n && Mod[i, 2] != t, b[n-i, i-1, Mod[i, 2]], 0]]]; a[n_] := If[n==0, 1, Sum[b[n-i, i-1, Mod[i, 2]], {i, 1, n}]]; Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, Mar 24 2015, after _Alois P. Heinz_ *)
%o (Sage)
%o odd_diffs = lambda x: all(abs(d) % 2 for d in differences(x))
%o satisfies = lambda p: not p or (min(p) % 2 and odd_diffs(p))
%o def A179049(n):
%o return len([1 for p in Partitions(n,max_slope=-1) if satisfies(p)])
%o # _D. S. McNeil_, Jan 04 2011; adapted by _F. Chapoton_, Feb 24 2020
%o (Sage) # Alternative, after _Alois P. Heinz_:
%o def A179049(n):
%o @cached_function
%o def h(n, k):
%o if n == 0: return 1
%o if k > n: return 0
%o return h(n, k+2) + h(n-k, k+1)
%o return h(n, 1)
%o [A179049(n) for n in range(70)] # _Peter Luschny_, Feb 25 2020
%o (PARI) N=99; x='x+O('x^N); Vec(sum(n=0,N, x^(n*(n+1)/2)/prod(k=1,n,1-x^(2*k))))
%Y Cf. A000009.
%Y Cf. A218355 (parts are even, odd, even, odd, ...).
%K nonn,easy
%O 0,4
%A _Joerg Arndt_, Jan 04 2011