OFFSET
0,4
COMMENTS
Parts are odd, even, odd, even, ... [Joerg Arndt, Oct 27 2012]
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
G. E. Andrews, Ramanujan’s “lost” notebook. IV. Stacks and alternating parity in partitions, Adv. in Math. 53 (1984), no. 1, 55-74.
Min-Joo Jang, Asymptotic behavior of odd-even partitions, arXiv:1703.01837v1 [math.NT], 2017.
FORMULA
G.f.: Sum_{n>=0} x^(n*(n+1)/2) / Product_{k=1..n} (1 - x^(2*k)).
a(n) ~ (1/(2*sqrt(5)*n^(3/4)))*exp(Pi*sqrt(n/5)) [Jang 2017]. - Peter Bala, Mar 28 2017
EXAMPLE
From Joerg Arndt, Oct 27 2012: (Start)
The a(20) = 14 such partitions of 20 are:
[ 1] 1 2 3 14
[ 2] 1 2 5 12
[ 3] 1 2 7 10
[ 4] 1 2 17
[ 5] 1 4 5 10
[ 6] 1 4 7 8
[ 7] 1 4 15
[ 8] 1 6 13
[ 9] 1 8 11
[10] 3 4 5 8
[11] 3 4 13
[12] 3 6 11
[13] 3 8 9
[14] 5 6 9
(End)
MAPLE
b:= proc(n, i) option remember; `if`(n=0, 1,
`if`(i>n, 0, b(n, i+2)+b(n-i, i+1)))
end:
a:= n-> b(n, 1):
seq(a(n), n=0..100); # Alois P. Heinz, Nov 08 2012; revised Feb 24 2020
MATHEMATICA
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 *)
PROG
(Sage)
odd_diffs = lambda x: all(abs(d) % 2 for d in differences(x))
satisfies = lambda p: not p or (min(p) % 2 and odd_diffs(p))
def A179049(n):
return len([1 for p in Partitions(n, max_slope=-1) if satisfies(p)])
# D. S. McNeil, Jan 04 2011; adapted by F. Chapoton, Feb 24 2020
(Sage) # Alternative, after Alois P. Heinz:
def A179049(n):
@cached_function
def h(n, k):
if n == 0: return 1
if k > n: return 0
return h(n, k+2) + h(n-k, k+1)
return h(n, 1)
[A179049(n) for n in range(70)] # Peter Luschny, Feb 25 2020
(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))))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Joerg Arndt, Jan 04 2011
STATUS
approved