%I #26 Mar 19 2022 12:45:57
%S 1,1,4,4,12,20,40,70,150,284,564,1116,2212,4392,8768,17404,34704,
%T 69214,137980,275264,549340,1096244,2188344,4369196,8724196,17422500,
%U 34797476,69505628,138845940,277383904,554189344,1107296248,2212559996,4421289872,8835361488
%N (1/n) times the sum of the elements of all subsets of [n] whose sum is divisible by n.
%H Alois P. Heinz, <a href="/A309128/b309128.txt">Table of n, a(n) for n = 1..1000</a>
%F Conjecture: a(n) = (n + 1) * A063776(n)/4 - (phi(n)/2) * (1 + (-1)^n)/2 = ((n + 1)/(4*n)) * A053636(n) - (phi(n)/2) * (1 + (-1)^n)/2. - _Petros Hadjicostas_, Jul 20 2019
%F a(n) = A309280(n,n). - _Alois P. Heinz_, Jul 21 2019
%e The subsets of [5] whose sum is divisible by 5 are: {}, {5}, {1,4}, {2,3}, {1,4,5}, {2,3,5}, {1,2,3,4}, {1,2,3,4,5}. The sum of their elements is 0 + 5 + 5 + 5 + 10 + 10 + 10 + 15 = 60. So a(5) = 60/5 = 12.
%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]*n])(b(n-1, m, irem(s+n, m))))
%p end:
%p a:= proc(n) option remember; forget(b); b(n$2, 0)[2]/n 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]] n}][b[n-1, m, Mod[s+n, m]]]];
%t a[n_] := b[n, n, 0][[2]]/n;
%t Table[a[n], {n, 1, 40}] (* _Jean-François Alcover_, Mar 19 2022, after _Alois P. Heinz_ *)
%Y Cf. A000010, A001792 (the same for all subsets), A053636, A063776, A309122, A309280.
%K nonn
%O 1,3
%A _Alois P. Heinz_, Jul 13 2019