login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Sum of the sizes of all subsets of [n] whose sum is divisible by n.
3

%I #36 Mar 19 2022 09:21:33

%S 1,1,6,6,20,34,70,124,270,516,1034,2060,4108,8198,16440,32760,65552,

%T 131142,262162,524312,1048740,2097162,4194326,8388856,16777300,

%U 33554444,67109418,134217764,268435484,536872072,1073741854,2147483632,4294969404,8589934608

%N Sum of the sizes of all subsets of [n] whose sum is divisible by n.

%C The bivariate g.f. of array T(n,k) = A267632(n,k) is Sum_{n, k >= 1} T(n,k) * x^n * y^k = -x/(1 - x) - Sum_{s >= 1} (phi(s)/s) * log(1 - x^s + (-x*y)^s). Differentiating w.r.t. y and setting y = 1, we get the g.f. of a(n) = k * Sum_{1 <= k <= n} T(n,k) (see below). - _Petros Hadjicostas_, Jul 13 2019

%H Alois P. Heinz, <a href="/A309122/b309122.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = Sum_{k=1..n} k * A267632(n,k).

%F From _Petros Hadjicostas_, Jul 13 2019: (Start)

%F G.f.: Sum_{s >= 1} phi(s) * (-x)^(s-1)/(1 - x^s + (-x)^s) = -Sum_{m >= 1} phi(2*m) * x^(2*m-1) + Sum_{m >= 0} phi(2*m+1) * x^(2*m)/(1 - 2*x^(2*m+1)).

%F a(2*m + 1) = A053636(2*m + 1)/2 = (1/2) * Sum_{d|2*m+1} phi(d) * 2^((2*m+1)/d) for m >= 0.

%F a(2*m) = -phi(2*m) + A053636(2*m)/2 for m >= 1.

%F (End)

%e a(5) = 20 = 0 + 1 + 2 + 2 + 3 + 3 + 4 + 5 = |{}| + |{5}| + |{1,4}| + |{2,3}| + |{1,4,5}| + |{2,3,5}| + |{1,2,3,4}| + |{1,2,3,4,5}|.

%p b:= proc(n, m, s) option remember; `if`(n=0, [`if`(s=0, 1, 0), 0],

%p b(n-1, m, s) +(g-> g+[0, g[1]])(b(n-1, m, irem(s+n, m))))

%p end:

%p a:= proc(n) option remember; forget(b); b(n$2, 0)[2] end:

%p seq(a(n), n=1..40);

%t b[n_, m_, s_] := b[n, m, s] = If[n == 0, {If[s == 0, 1, 0], 0},

%t b[n-1, m, s] + Function[g, g + {0, g[[1]]}][b[n-1, m, Mod[s+n, m]]]];

%t a[n_] := b[n, n, 0][[2]];

%t Table[a[n], {n, 1, 40}] (* _Jean-François Alcover_, Mar 19 2022, after _Alois P. Heinz_ *)

%Y Cf. A000010, A053636, A267632, A309128.

%K nonn

%O 1,3

%A _Alois P. Heinz_, Jul 13 2019