OFFSET
0,4
COMMENTS
If k is allowed to approach infinity, this gives the partition numbers A000009.
a(n) is the maximal number of subsets of {1,2,...,n} that share the same sum.
LINKS
T. D. Noe, Alois P. Heinz and Ray Chandler, Table of n, a(n) for n = 0..3339 (terms < 10^1000, first 201 terms from T. D. Noe, next 200 terms from Alois P. Heinz)
Dorin Andrica and Ioan Tomescu, On an Integer Sequence Related to a Product of Trigonometric Functions, and Its Combinatorial Relevance , Journal of Integer Sequences, Vol. 5 (2002), Article 02.2.4.
Vlad-Florin Dragoi and Valeriu Beiu, Fast Reliability Ranking of Matchstick Minimal Networks, arXiv:1911.01153 [cs.DM], 2019.
Steven R. Finch, Signum equations and extremal coefficients, February 7, 2009. [Cached copy, with permission of the author]
Erich Friedman and Mike Keith, Magic Carpets, J. Int Sequences, 3 (2000), Article 00.2.5.
Susumu Kubo, Partially Ordered Sets Corresponding to the Partition Problem, arXiv:2405.05544 [cs.DM], 2024. See pp. 2, 16.
Marco Mondelli, S. Hamed Hassani, and Rüdiger Urbanke, Construction of Polar Codes with Sublinear Complexity, arXiv preprint arXiv:1612.05295 [cs.IT], 2016-2017. See Sect. I.
Robert A. Proctor, Solution of two difficult combinatorial problems with linear algebra, American Mathematical Monthly 89, 721-734.
Blair D. Sullivan, On a conjecture of Adrica and Tomescu, J. Int. Sequences 16 (2013), Article 13.3.1.
FORMULA
a(n) ~ sqrt(6/Pi) * 2^n / n^(3/2) [conjectured by Andrica and Tomescu (2002) and proved by Sullivan (2013)]. - Vaclav Kotesovec, Mar 17 2020
More precise asymptotics: a(n) ~ sqrt(6/Pi) * 2^n / n^(3/2) * (1 - 6/(5*n) + 589/(560*n^2) - 39/(50*n^3) + ...). - Vaclav Kotesovec, Dec 30 2022
a(n) = max_{k>=0} A053632(n,k). - Alois P. Heinz, Jan 20 2023
MAPLE
b:= proc(n, i) option remember; `if`(n>i*(i+1)/2, 0,
`if`(i=0, 1, b(n+i, i-1)+b(abs(n-i), i-1)))
end:
a:=n-> b(0, n)+b(1, n):
seq(a(n), n=0..40); # Alois P. Heinz, Mar 10 2014
MATHEMATICA
f[n_, s_] := f[n, s]=Which[n==0, If[s==0, 1, 0], Abs[s]>(n*(n+1))/2, 0, True, f[n-1, s-n]+f[n-1, s+n]]; Table[Which[Mod[n, 4]==0||Mod[n, 4]==3, f[n, 0], Mod[n, 4]==1||Mod[n, 4]==2, f[n, 1]], {n, 0, 40}]
(* Second program: *)
p = 1; Flatten[{1, Table[p = Expand[p*(1 + x^n)]; Max[CoefficientList[p, x]], {n, 1, 50}]}] (* Vaclav Kotesovec, May 04 2018 *)
b[n_, i_] := b[n, i] = If[n > i(i+1)/2, 0, If[i == 0, 1, b[n+i, i-1] + b[Abs[n-i], i-1]]];
a[n_] := b[0, n] + b[1, n]; a /@ Range[0, 40] (* Jean-François Alcover, Feb 17 2020, after Alois P. Heinz *)
PROG
(PARI) a(n)=if(n<0, 0, polcoeff(prod(k=1, n, 1+x^k), n*(n+1)\4))
(Python)
from collections import Counter
def A025591(n):
c = {0:1, 1:1}
for i in range(2, n+1):
d = Counter(c)
for k in c:
d[k+i] += c[k]
c = d
return max(c.values()) # Chai Wah Wu, Jan 31 2024
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
STATUS
approved