OFFSET
1,3
COMMENTS
a(n,k) <= n^(k+1).
FORMULA
a(n, 1) = 2*n - 1;
a(n, 2) = 4*n^2 - 6*n + 3;
a(n, 3) = 8*n^3 - 28*n^2 + 44*n - 23, n odd;
a(n, 3) = 8*n^3 - 28*n^2 + 44*n - 25, n even;
a(1, k) = 1;
a(2, k) = 2^(k+1) - 1;
a(3, k) = 3^(k+1) - 2*k - 2.
EXAMPLE
Table begins
1, 1, 1, 1, 1, ...
3, 7, 15, 31, 63, ...
5, 21, 73, 233, 717, ...
7, 43, 215, 951, 3971, ...
9, 73, 497, 2865, 15161, ...
...
MATHEMATICA
<<DiscreteMath`Combinatorica`;
SubsetSums[l_]:=Plus@@#&/@Subsets[l];
NumSumsModN[l_, n_]:=Length[Union[Mod[SubsetSums[l], n]]];
a[1, k_]:=1;
a[n_, k_]:=Plus@@Table[NumSumsModN[IntegerDigits[x, n, k], n], {x, 0, n^k-1}];
Flatten[Table[a[n, j-n], {j, 1, 10}, {n, 1, j-1}]]
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Andrew Childs (amchilds(AT)caltech.edu) and Wim van Dam (vandam(AT)cs.ucsb.edu), Oct 13 2004
STATUS
approved