cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A025591 Maximal coefficient of Product_{k<=n} (1 + x^k). Number of solutions to +- 1 +- 2 +- 3 +- ... +- n = 0 or 1.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 5, 8, 14, 23, 40, 70, 124, 221, 397, 722, 1314, 2410, 4441, 8220, 15272, 28460, 53222, 99820, 187692, 353743, 668273, 1265204, 2399784, 4559828, 8679280, 16547220, 31592878, 60400688, 115633260, 221653776, 425363952, 817175698
Offset: 0

Views

Author

Keywords

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.

Crossrefs

Programs

  • 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 *)
  • 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

Formula

a(n) = A063865(n) + A063866(n).
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

A160235 The maximal coefficient of (1+x)*(1+x^4)*(1+x^9)*...*(1+x^(n^2)).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 3, 5, 6, 9, 14, 21, 32, 54, 87, 144, 230, 383, 671, 1158, 1981, 3408, 6246, 10925, 19463, 34624, 63941, 114954, 208429, 380130, 707194, 1298600, 2379842, 4398644, 8253618, 15303057, 28453809, 53091455, 100061278, 187446097
Offset: 0

Views

Author

Theodore Kolokolnikov, May 05 2009

Keywords

Crossrefs

Programs

  • Maple
    for N from 1 to 40 do
    p := expand(product(1+x^(n^2), n=1..N)):
    L:=convert(PolynomialTools[CoefficientVector](p, x), list):
    mmax := max(op(map(abs, L)));
    lprint(mmax):
    end:
  • Mathematica
    p = 1; Table[p = Expand[p*(1 + x^(n^2))]; Max[CoefficientList[p, x]], {n, 1, 50}] (* Vaclav Kotesovec, May 04 2018 *)
    nmax = 100; poly = ConstantArray[0, nmax*(nmax+1)*(2*nmax+1)/6 + 1]; poly[[1]] = 1; poly[[2]] = 1; Do[Do[poly[[j + 1]] += poly[[j - k^2 + 1]], {j, k*(k+1)*(2*k+1)/6, k^2, -1}]; Print[k, " ", Max[poly]], {k, 2, nmax}]; (* Vaclav Kotesovec, Dec 30 2022 *)

Formula

An asymptotic formula is a(n) ~ sqrt(10/Pi) * n^(-5/2) * 2^n. See for example the reference by Finch.
More precise asymptotics: a(n) ~ sqrt(10/Pi) * 2^n / n^(5/2) * (1 - 35/(18*n) + ...). - Vaclav Kotesovec, Dec 30 2022

Extensions

a(0)=1 prepended by Seiichi Manyama, Dec 26 2022

A359319 Maximal coefficient of (1 + x) * (1 + x^8) * (1 + x^27) * ... * (1 + x^(n^3)).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 4, 5, 7, 10, 14, 18, 27, 36, 62, 95, 140, 241, 370, 607, 1014, 1646, 2751, 4863, 8260, 13909, 24870, 41671, 73936, 131257, 228204, 411128, 737620, 1292651, 2324494, 4253857, 7487549, 13710736, 25291179, 44938191, 82814603
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 25 2022

Keywords

Comments

Conjecture: Maximal coefficient of Product_{k=1..n} (1 + x^(n^m)) ~ sqrt(4*m + 2) * 2^n / (sqrt(Pi) * n^(m + 1/2)), for m>=0. - Vaclav Kotesovec, Dec 30 2022

Crossrefs

Programs

  • Mathematica
    Table[Max[CoefficientList[Product[1+x^(k^3),{k,n}],x]],{n,0,44}] (* Stefano Spezia, Dec 25 2022 *)
    nmax = 100; poly = ConstantArray[0, nmax^2*(nmax + 1)^2/4 + 1]; poly[[1]] = 1; poly[[2]] = 1; Do[Do[poly[[j + 1]] += poly[[j - k^3 + 1]], {j, k^2*(k + 1)^2/4, k^3, -1}]; Print[k, " ", Max[poly]], {k, 2, nmax}]; (* Vaclav Kotesovec, Dec 29 2022 *)
  • PARI
    a(n) = vecmax(Vec(prod(i=1, n, (1+x^(i^3))))); \\ Michel Marcus, Dec 27 2022

Formula

Conjecture: a(n) ~ sqrt(14) * 2^n / (sqrt(Pi) * n^(7/2)). - Vaclav Kotesovec, Dec 30 2022
Showing 1-3 of 3 results.