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-6 of 6 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

A039909 Largest coefficient in expansion of Product_{i=1..n} (1-q^1+q^2-...+(-q)^i).

Original entry on oeis.org

1, 1, 2, 5, 20, 101, 573, 3836, 29228, 250749, 2409581, 25380120, 294625748, 3727542188, 50626553988, 738680521142, 11501573822788, 190418421447330, 3344822488498265, 61995904304519920, 1212867413232346644, 24965661442811799655, 538134522243713149122
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    PS:=PowerSeriesRing(Integers()); [ Max(Coefficients(&*[&+[ (-q)^i: i in [0..j] ]: j in [0..n] ])): n in [1..20] ]; // Klaus Brockhaus, Jan 18 2011
    
  • PARI
    a(n) = vecmax(Vec(prod(j=1, n, sum(k=0, j, (-x)^k)))); \\ Seiichi Manyama, Jan 05 2023

Formula

Conjecture: a(n) ~ 6 * n^n / exp(n). - Vaclav Kotesovec, Jan 05 2023

Extensions

a(0)=1 prepended by Seiichi Manyama, Jan 05 2023

A369773 Maximal coefficient of (1 + x) * (1 + x - x^2) * ... * (1 + x - x^2 + ... - (-x)^n).

Original entry on oeis.org

1, 1, 2, 3, 4, 6, 19, 59, 233, 1189, 7046, 45326, 356517, 3108808, 30028121, 325635647, 3830546752, 49403859787, 685063715374, 10162709827329, 162776892315940, 2754021620252692, 49463507801582609, 940216720983170113, 18786988751008626812
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 31 2024

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Max[CoefficientList[Product[(1 - Sum[(-x)^j, {j, 1, i}]), {i, 1, n}], x]], {n, 0, 24}]
  • Python
    from collections import Counter
    def A369773(n):
        c = {0:1}
        for k in range(1,n+1):
            d = Counter(c)
            for j in c:
                a = c[j]
                for i in range(1,k+1):
                    d[j+i] += (a if i&1 else -a)
            c = d
        return max(c.values()) # Chai Wah Wu, Feb 01 2024

A039829 Number of different coefficient values in expansion of Product_{i=1..n} (1 + (-q)^i).

Original entry on oeis.org

2, 2, 3, 4, 6, 10, 13, 17, 36, 48, 33, 39, 86, 100, 60, 68, 148, 166, 95, 105, 226, 248, 138, 150, 320, 346, 189, 203, 430, 460, 248, 264, 556, 590, 315, 333, 698, 736, 390, 410, 856, 898, 473, 495, 1030, 1076, 564, 588, 1220, 1270
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • PARI
    a(n) = #vecsort(Vec(prod(i = 1, n, (1 + (-q)^i))), , 8) \\ David A. Corneth, Aug 29 2018

A350504 Maximal coefficient of (1 + x) * (1 + x^3) * (1 + x^5) * ... * (1 + x^(2*n-1)).

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 3, 5, 8, 13, 22, 38, 68, 118, 211, 380, 692, 1262, 2316, 4277, 7930, 14745, 27517, 51541, 96792, 182182, 343711, 650095, 1231932, 2338706, 4447510, 8472697, 16164914, 30884150, 59086618, 113189168, 217091832, 416839177, 801247614, 1541726967, 2969432270
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 28 2022

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, 1,
          expand((1+x^(2*n-1))*b(n-1)))
        end:
    a:= n-> max(coeffs(b(n))):
    seq(a(n), n=0..40);  # Alois P. Heinz, Jan 28 2022
  • Mathematica
    b[n_] := b[n] = If[n == 0, 1, Expand[(1 + x^(2*n - 1))*b[n - 1]]];
    a[n_] := Max[CoefficientList[b[n], x]];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Mar 01 2022, after Alois P. Heinz *)
  • PARI
    a(n) = vecmax(Vec(prod(k=1, n, 1+x^(2*k-1)))); \\ Seiichi Manyama, Jan 28 2021

Formula

a(n) ~ sqrt(3) * 2^(n - 1/2) / (sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Feb 04 2022

A369705 Maximal coefficient of (1 + x) * (1 - x^2) * (1 + x^3) * ... * (1 - (-x)^n).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 2, 2, 3, 3, 4, 6, 5, 6, 7, 7, 8, 10, 11, 16, 16, 19, 21, 23, 28, 34, 41, 50, 56, 68, 80, 91, 110, 135, 158, 196, 225, 269, 320, 376, 447, 544, 644, 786, 921, 1111, 1321, 1573, 1882, 2274, 2711, 3280, 3895, 4694, 5591, 6718
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 29 2024

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, 1, expand(b(n-1)*(1-(-x)^n))) end:
    a:= n-> max(coeffs(b(n))):
    seq(a(n), n=0..60);  # Alois P. Heinz, Jan 29 2024
  • Mathematica
    Table[Max[CoefficientList[Product[(1 - (-x)^k), {k, 1, n}], x]], {n, 0, 60}]
  • PARI
    a(n) = vecmax(Vec(prod(k=1, n, (1-(-x)^k)))); \\ Michel Marcus, Jan 30 2024
Showing 1-6 of 6 results.