OFFSET
0,5
COMMENTS
Arises in studying a conjecture related to lunar divisors in base 2.
a(n) is the number of compositions of n where the first part is even, say, 2*f and the other parts are <= f. - Joerg Arndt, Jan 04 2024
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..3343
D. Applegate, M. LeBrun and N. J. A. Sloane, Dismal Arithmetic, arXiv:1107.1130 [math.NT], 2011. [Note: we have now changed the name from "dismal arithmetic" to "lunar arithmetic" - the old name was too depressing]
FORMULA
G.f.: Sum_{n>=0} x^(2*n)/(1 - Sum_{k=1..n} x^k). - Joerg Arndt, Jan 04 2024
EXAMPLE
From Joerg Arndt, Jan 04 2024: (Start)
There are a(10) = 24 compositions of 10 of the specified type:
1: [ 2 1 1 1 1 1 1 1 1 ]
2: [ 4 1 1 1 1 1 1 ]
3: [ 4 1 1 1 1 2 ]
4: [ 4 1 1 1 2 1 ]
5: [ 4 1 1 2 1 1 ]
6: [ 4 1 1 2 2 ]
7: [ 4 1 2 1 1 1 ]
8: [ 4 1 2 1 2 ]
9: [ 4 1 2 2 1 ]
10: [ 4 2 1 1 1 1 ]
11: [ 4 2 1 1 2 ]
12: [ 4 2 1 2 1 ]
13: [ 4 2 2 1 1 ]
14: [ 4 2 2 2 ]
15: [ 6 1 1 1 1 ]
16: [ 6 1 1 2 ]
17: [ 6 1 2 1 ]
18: [ 6 1 3 ]
19: [ 6 2 1 1 ]
20: [ 6 2 2 ]
21: [ 6 3 1 ]
22: [ 8 1 1 ]
23: [ 8 2 ]
24: [ 10 ]
(End)
MAPLE
b:= proc(n, m) option remember; `if`(n=0, 1,
`if`(m=0, add(b(n-j, j), j=1..n),
add(b(n-j, min(n-j, m)), j=1..min(n, m))))
end:
a:= n-> 2*b(n, 0)-b(n+1, 0):
seq(a(n), n=0..46); # Alois P. Heinz, Jan 04 2024
MATHEMATICA
b[n_, m_] := b[n, m] = If[n == 0, 1, If[m == 0, Sum[b[n-j, j], {j, 1, n}], Sum[b[n-j, Min[n-j, m]], {j, 1, Min[n, m]}]]];
a79500[n_] := b[n, 0];
a[n_] := -a79500[n+1] + 2 a79500[n];
PROG
(SageMath)
def C(n): return sum(Compositions(n, max_part=k, inner=[k]).cardinality()
for k in (0..n))
def a(n): return 2*C(n) - C(n+1) if n > 0 else 1
print([a(n) for n in (0..18)]) # Peter Luschny, Jan 04 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Apr 03 2011
EXTENSIONS
Offset changed to 0 by N. J. A. Sloane, Jan 04 2024 at the suggestion of Joerg Arndt.
STATUS
approved