A066571 Number of sets of positive integers with arithmetic mean n.
1, 3, 9, 31, 117, 479, 2061, 9183, 42021, 196239, 931457, 4480531, 21793257, 107004891, 529656765, 2640160039, 13241371629, 66771501151, 338333343825, 1721768732423, 8796192611917, 45096680384635, 231945566136129, 1196461977291959, 6188390166782849
Offset: 1
Examples
a(2) = 3 as there are three sets viz. {2}, {1,3}, {1,2,3}, each of which has the arithmetic mean 2. a(3) = 9: the nine sets are {3}, {1, 5}, {2, 4}, {1, 2, 6}, {1, 3, 5}, {2, 3, 4}, {1, 2, 3, 6}, {1, 2, 4, 5}, {1, 2, 3, 4, 5}.
Links
- Martin Fuller, Table of n, a(n) for n = 1..200
Programs
-
Haskell
a066571 n = f [1..] 1 n 0 where f (k:ks) l nl x | y > nl = 0 | y < nl = f ks (l + 1) (nl + n) y + f ks l nl x | otherwise = if y `mod` l == 0 then 1 else 0 where y = x + k -- Reinhard Zumkeller, Feb 13 2013
-
Maple
g := k->expand(mul(1+t*x^i,i=1..k)); A066571 := proc(n) local k; add(coeff(coeff(g(n*k),t,k),x,n*k),k=1..2*n-1); end;
-
Mathematica
g[k_] := Expand[Product[1 + t*x^i, {i, 1, k}]]; a[n_] := Sum[Coefficient[ Coefficient[g[n*k], t, k], x, n*k], {k, 1, 2*n - 1}]; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 10}] (* Jean-François Alcover, Feb 10 2018, translated from Maple *)
Formula
Sum of coefficient of t^k x^(n*k) in Product_{i=1..n*k} (1+t*x^i) for k <= 2*n-1. - N. J. A. Sloane
From Martin Fuller, Sep 14 2023: (Start)
Constant term in formal Laurent series (Product_{i=1-n..n*(n-1)/2} (1+x^i)) - 1.
Extensions
Corrected and extended by N. J. A. Sloane, Dec 19 2001
More terms from Naohiro Nomoto, Jun 19 2002
More terms from David Wasserman, Sep 10 2002
More terms from Martin Fuller, Sep 14 2023
Comments