OFFSET
1,2
COMMENTS
Also the number of compositions of n whose length divides n, i.e., compositions with integer mean, ranked by A096199. - Gus Wiseman, Sep 28 2022
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..3329
EXAMPLE
From Gus Wiseman, Sep 28 2022: (Start)
The a(1) = 1 through a(6) = 17 compositions with integer mean:
(1) (2) (3) (4) (5) (6)
(1,1) (1,1,1) (1,3) (1,1,1,1,1) (1,5)
(2,2) (2,4)
(3,1) (3,3)
(1,1,1,1) (4,2)
(5,1)
(1,1,4)
(1,2,3)
(1,3,2)
(1,4,1)
(2,1,3)
(2,2,2)
(2,3,1)
(3,1,2)
(3,2,1)
(4,1,1)
(1,1,1,1,1,1)
(End)
MAPLE
a:= n-> add(binomial(n-1, d-1), d=numtheory[divisors](n)):
seq(a(n), n=1..50); # Alois P. Heinz, Dec 03 2023
MATHEMATICA
Table[Length[Join @@ Permutations/@Select[IntegerPartitions[n], IntegerQ[Mean[#]]&]], {n, 15}] (* Gus Wiseman, Sep 28 2022 *)
PROG
(PARI) a(n)=sumdiv(n, k, binomial(n-1, k-1))
KEYWORD
nonn
AUTHOR
Franklin T. Adams-Watters, Apr 11 2016
STATUS
approved