OFFSET
1,4
COMMENTS
Number of compositions (ordered partitions) of n into distinct parts where either all parts are odd or all parts are even, and where every odd part or even part between the largest and smallest appears.
Number of compositions of n that are either singular compositions (just [n]), or where the difference between successive parts is always 2. - Antti Karttunen, Dec 15 2021
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
FORMULA
From Antti Karttunen, Dec 15 2021: (Start)
a(n) = Sum_{d|n, d <= n/d} d!.
a(2n-1) = A332032(2n-1) for all n >= 1.
(End)
EXAMPLE
a(12) = 9 because we have [12], [7, 5], [6, 4, 2], [6, 2, 4], [5, 7], [4, 6, 2], [4, 2, 6], [2, 6, 4] and [2, 4, 6].
MATHEMATICA
nmax = 75; CoefficientList[Series[Sum[k! x^(k^2)/(1 - x^k), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
PROG
(PARI) A332031(n) = sumdiv(n, d, (d<=(n/d)) * d!); \\ Antti Karttunen, Dec 15 2021
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Ilya Gutkovskiy, Feb 05 2020
STATUS
approved