OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
Dandan Chen and Rong Chen, Generating Functions of the Hurwitz Class Numbers Associated with Certain Mock Theta Functions, arXiv:2107.04809 [math.NT], 2021.
FORMULA
a(2*n) = A130695(2*n) / 3 if n>0. a(2*n + 1) = A130695(2*n + 1) = 3 * H(8*n + 3), where H is the Hurwitz class number, if n>0. - Michael Somos, Jul 04 2015
EXAMPLE
The a(33) = 15 such compositions of 33 are:
01: [ 1 2 3 4 5 6 5 4 3 ]
02: [ 2 3 4 5 6 7 6 ]
03: [ 3 4 5 6 5 4 3 2 1 ]
04: [ 3 4 5 6 7 8 ]
05: [ 4 5 6 7 6 5 ]
06: [ 5 6 7 6 5 4 ]
07: [ 5 6 7 8 7 ]
08: [ 6 7 6 5 4 3 2 ]
09: [ 7 8 7 6 5 ]
10: [ 8 7 6 5 4 3 ]
11: [ 10 11 12 ]
12: [ 12 11 10 ]
13: [ 16 17 ]
14: [ 17 16 ]
15: [ 33 ]
G.f. = 1 + x + x^2 + 3*x^3 + 2*x^4 + 3*x^5 + 3*x^6 + 4*x^7 + 3*x^8 + 6*x^9 + ...
MATHEMATICA
a[ n_] := If[ n < 1, Boole[n == 0], If[ OddQ[n], 1, 1/3] Length @ FindInstance[ {x >= 0, y >= 0, z >= 0, x y + y z + z x + x + y + z + 1 == n}, {x, y, z}, Integers, 10^9]]; (* Michael Somos, Jul 04 2015 *)
a[ n_] := If[ n < 1, Boole[n == 0], Length @ FindInstance[ {1 <= y <= n, 1 <= x <= y, 1 <= z <= y, y^2 + (x - x^2 + z - z^2) / 2 == n}, {x, y, z}, Integers, 10^9]]; (* Michael Somos, Jul 04 2015 *)
PROG
(PARI) \\ generate the compositions
a(n)=
{
if ( n==0, return(1) );
my( ret=0 );
my( as, ts );
for (f=1, n, \\ first part
as = 0;
for (p=f, n, \\ numper of parts in rising half
as += p; \\ ascending sum
if ( as > n, break() );
if ( as == n, ret+=1; break() );
ts = as; \\ total sum
forstep (q=p-1, 1, -1,
ts += q; \\ descending sum
if ( ts > n, break() );
if ( ts == n, ret+=1; break() );
);
);
);
return( ret );
}
v=vector(100, n, a(n-1))
CROSSREFS
KEYWORD
nonn
AUTHOR
Joerg Arndt, Mar 21 2014
STATUS
approved