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.

Previous Showing 11-20 of 51 results. Next

A083527 a(n) is the number of times that sums 1+-4+-9+-16+-...+-n^2 of the first n squares is zero. There are 2^(n-1) choices for the sign patterns.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 5, 0, 0, 43, 57, 0, 0, 239, 430, 0, 0, 2904, 5419, 0, 0, 27813, 50213, 0, 0, 348082, 649300, 0, 0, 3913496, 7287183, 0, 0, 50030553, 93696497, 0, 0, 611793542, 1161079907, 0, 0, 8009933135, 15176652567, 0, 0
Offset: 1

Views

Author

T. D. Noe, Apr 29 2003

Keywords

Comments

The frequency of each possible sum is computed by the Mathematica program without explicitly computing the individual sums.
a(n) is the maximal number of subsets of the first n squares that share the same sum. Cf. A025591, A083309.
a(n)=0 when n==1 or 2 (mod 4).

Examples

			a(7) = 1 because there is only one sign pattern of the first seven squares that yields zero: 1+4-9+16-25-36+49.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; local m;
          m:= (1+(3+2*i)*i)*i/6;
          `if`(n>m, 0, `if`(n=m, 1, b(abs(n-i^2), i-1) +b(n+i^2, i-1)))
        end:
    a:= n-> `if`(irem(n-1, 4)<2, 0, b(n^2, n-1)):
    seq(a(n), n=1..40);  # Alois P. Heinz, Oct 31 2011
  • Mathematica
    d={1, 1}; nMax=60; zeroLst={0}; Do[p=n^2; d=PadLeft[d, Length[d]+p]+PadRight[d, Length[d]+p]; If[1==Mod[Length[d], 2], AppendTo[zeroLst, d[[(Length[d]+1)/2]]], AppendTo[zeroLst, 0]], {n, 2, nMax}]; zeroLst/2
    p = 1; t = {}; Do[p = Expand[p(x^(n^2) + x^(-n^2))]; AppendTo[t, Select[p, NumberQ[ # ] &]/2], {n, 51}]; t (* Robert G. Wilson v, Oct 31 2005 *)
  • PARI
    a(n)=sum(i=0,2^(n-1)-1,sum(j=1,n-1,(-1)^bittest(i,j-1)*j^2)==n^2) \\ Charles R Greathouse IV, Nov 05 2012

Formula

a(n) is half the coefficient of x^0 in the product_{k=1..n} x^(k^2)+x^(k^-2).
a(n) = A158092(n)/2.
a(n) = [x^(n^2)] Product_{k=1..n-1} (x^(k^2) + 1/x^(k^2)). - Ilya Gutkovskiy, Feb 01 2024

A350457 Maximal coefficient of (1 + x^2) * (1 + x^3) * (1 + x^5) * ... * (1 + x^prime(n)).

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 4, 4, 7, 10, 16, 27, 45, 79, 139, 249, 439, 784, 1419, 2574, 4703, 8682, 16021, 29720, 55146, 102170, 190274, 356804, 671224, 1269022, 2404289, 4521836, 8535117, 16134474, 30635869, 58062404, 110496946, 210500898, 401422210, 767158570, 1467402238
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 01 2022

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, 1,
          expand((1+x^ithprime(n))*b(n-1)))
        end:
    a:= n-> max(coeffs(b(n))):
    seq(a(n), n=0..40);  # Alois P. Heinz, Jan 01 2022
  • Mathematica
    b[n_] := b[n] = If[n == 0, 1, Expand[(1 + x^Prime[n])*b[n - 1]]];
    a[n_] := Max[CoefficientList[b[n], x]];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Feb 26 2022, after Alois P. Heinz *)
  • PARI
    a(n) = vecmax(Vec(prod(k=1, n, 1 + x^prime(k)))); \\ Michel Marcus, Jan 01 2022
    
  • Python
    from sympy.abc import x
    from sympy import prime, prod
    def A350457(n): return 1 if n == 0 else max(prod(1+x**prime(i) for i in range(1,n+1)).as_poly().coeffs()) # Chai Wah Wu, Jan 03 2022

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

A160089 The maximum of the absolute value of the coefficients of Pn = (1-x)(1-x^2)(1-x^3)...(1-x^n).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 3, 2, 4, 3, 3, 4, 6, 5, 6, 7, 8, 8, 10, 11, 16, 16, 19, 21, 28, 29, 34, 41, 50, 56, 68, 80, 100, 114, 135, 158, 196, 225, 269, 320, 388, 455, 544, 644, 786, 921, 1111, 1321, 1600, 1891, 2274, 2711, 3280, 3895, 4694, 5591, 6780, 8051, 9729, 11624
Offset: 0

Views

Author

Theodore Kolokolnikov, May 01 2009

Keywords

Comments

If n is even then a(n) is the absolute value of the coefficient of z^(n(n+1)/4). If n is odd, it is an open question as to which coefficient is a(n).
For odd n values, the Berkovich/Uncu reference provides explicit conjectural formulas for a(n). - Ali Uncu, Jul 19 2020

Crossrefs

Programs

  • Maple
    A160089 := proc(n)
            g := expand(mul( 1-x^k,k=1..n) );
            convert(PolynomialTools[CoefficientVector](g, x), list):
            max(op(map(abs, %)));
    end proc:
  • Mathematica
    p = 1; Flatten[{1, Table[p = Expand[p*(1 - x^n)]; Max[Abs[CoefficientList[p, x]]], {n, 1, 100}]}] (* Vaclav Kotesovec, May 03 2018 *)

Formula

a(n) >= A086376(n). - R. J. Mathar, Jun 01 2011
From Vaclav Kotesovec, May 04 2018: (Start)
a(n)^(1/n) tends to 1.2197...
Conjecture: a(n)^(1/n) ~ sqrt(A133871(n)^(1/n)) ~ 1.21971547612163368901359933...
(End)

Extensions

a(0)=1 prepended by Alois P. Heinz, Apr 12 2017

A063867 Number of solutions to +- 1 +- 2 +- 3 +- ... +- n = 0 or +- 1.

Original entry on oeis.org

1, 2, 2, 2, 2, 6, 10, 8, 14, 46, 80, 70, 124, 442, 794, 722, 1314, 4820, 8882, 8220, 15272, 56920, 106444, 99820, 187692, 707486, 1336546, 1265204, 2399784, 9119656, 17358560, 16547220, 31592878, 120801376, 231266520, 221653776
Offset: 0

Views

Author

N. J. A. Sloane, following a suggestion by J. H. Conway, Aug 27 2001

Keywords

Crossrefs

Programs

  • 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]]; a[n_] := f[n, 0]+2f[n, 1]

Formula

a(n) = A063865(n) + 2*A063866(n).

Extensions

More terms from Dean Hickerson and Vladeta Jovovic, Aug 28 2001

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

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 8, 14, 23, 40, 69, 123, 221, 397, 722, 1314, 2410, 4441, 8215, 15260, 28460, 53222, 99820, 187692, 353743, 668273, 1264854, 2399207, 4559828, 8679280, 16547220, 31592878, 60400688, 115633260, 221625505, 425313967
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • PARI
    a(n) = vecmax(Vec(prod(i = 1, n, (1 + (-q)^i)))); \\ Michel Marcus, Aug 30 2018

Formula

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

A069918 Number of ways of partitioning the set {1...n} into two subsets whose sums are as nearly equal as possible.

Original entry on oeis.org

1, 1, 1, 1, 3, 5, 4, 7, 23, 40, 35, 62, 221, 397, 361, 657, 2410, 4441, 4110, 7636, 28460, 53222, 49910, 93846, 353743, 668273, 632602, 1199892, 4559828, 8679280, 8273610, 15796439, 60400688, 115633260, 110826888, 212681976, 817175698, 1571588177, 1512776590
Offset: 1

Views

Author

Robert G. Wilson v, Apr 24 2002

Keywords

Comments

If n mod 4 = 0 or 3, a(n) is the number of solutions to +- 1 +- 2 +- 3 +- ... +- n = 0 or 1; if n mod 4 = 1 or 2, a(n) is half this number.

Examples

			If the triangular number T_n (see A000217) is even then the two totals must be equal, otherwise the two totals differ by one.
a(6) = 5: T6 = 21 and is odd. There are five sets such that the sum of one side is equal to the other side +/- 1. They are 5+6 = 1+2+3+4, 4+6 = 1+2+3+5, 1+4+6 = 2+3+5, 1+3+6 = 2+4+5 and 2+3+6 = 1+4+5.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; local m; m:= i*(i+1)/2;
          `if`(n>m, 0, `if`(n=m, 1, b(abs(n-i), i-1) +b(n+i, i-1)))
        end:
    a:= n-> `if`(irem(n-1, 4)<2, b(n-1, n-1) +b(n+1, n-1), b(n, n-1)):
    seq(a(n), n=1..60);  # Alois P. Heinz, Nov 02 2011
  • Mathematica
    Needs["DiscreteMath`Combinatorica`"]; f[n_] := f[n] = Block[{s = Sort[Plus @@@ Subsets[n]], k = n(n + 1)/2}, If[ EvenQ[k], Count[s, k/2]/2, (Count[s, Floor[k/2]] + Count[s, Ceiling[k/2]]) /2]]; Table[ f[n], {n, 1, 22}]
    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]/2, Mod[n, 4] == 1 || Mod[n, 4] == 2, f[n, 1]], {n, 1, 40}]

Formula

If n mod 4 = 0 or 3 then the two subsets have the same sum and a(n) = A025591(n); if n mod 4 = 1 or 2 then the two subsets have sums which differ by 1 and a(n) = A025591(n)/2. - Henry Bottomley, May 08 2002

Extensions

More terms from Henry Bottomley, May 08 2002
Comment corrected by Steven Finch, Feb 01 2009

A060468 Number of fair distributions (equal sum) of the integers {1,..,4n} between A and B = number of solutions to the equation {+-1 +-2 +- 3 ... +-4*n = 0}.

Original entry on oeis.org

1, 2, 14, 124, 1314, 15272, 187692, 2399784, 31592878, 425363952, 5830034720, 81072032060, 1140994231458, 16221323177468, 232615054822964, 3360682669655028, 48870013251334676, 714733339229024336
Offset: 0

Views

Author

Roland Bacher, Mar 15 2001

Keywords

Examples

			a(1)=2: give either the set {1,4} to A and {2,3} to B or give {2,3} to A and {1,4} to B.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Coefficient[Product[q^(-k) + q^k, {k, 1, 4*n}], q, 0]; Table[a[n], {n, 0, 17}] (* Jean-François Alcover, Sep 26 2013 *)

Formula

a(n) = coefficient of q^0 in Product_{k=1..4*n} (q^(-k) + q^k).
a(n) = A025591(4n) = A063865(4n) = A063867(4n) = 2*A060005(n). Seems to be close to sqrt(3/32Pi)*16^n/sqrt(n^3 + n^2*0.6 + n*0.1385...) and sqrt(n*Pi/2)*A063074(n). - Henry Bottomley, Jul 30 2005

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

A086394 (-1) times minimal coefficient of the polynomial (1-x)*(1-x^2)*...*(1-x^n).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5, 5, 7, 7, 8, 10, 11, 12, 16, 19, 21, 23, 29, 34, 41, 46, 56, 68, 80, 92, 114, 135, 158, 182, 225, 269, 320, 369, 455, 544, 644, 753, 921, 1111, 1321, 1543, 1891, 2274, 2711, 3183, 3895, 4694, 5591, 6592, 8051, 9729, 11624
Offset: 1

Views

Author

Yuval Dekel (dekelyuval(AT)hotmail.com), Sep 08 2003

Keywords

Crossrefs

Cf. A086376.
Cf. A025591.

Programs

  • Maple
    p:= proc(n) option remember; expand(
          `if`(n=0, 1, (x^n-1)*p(n-1)))
        end:
    a:= n-> -min(coeffs(p(n))):
    seq(a(n), n=1..80);  # Alois P. Heinz, Apr 12 2017
  • Mathematica
    p[n_] := p[n] = Expand[If[n == 0, 1, (x^n - 1)*p[n - 1]]];
    a[n_] := -Min[CoefficientList[p[n], x]];
    Table[a[n], {n, 1, 80}]; (* Jean-François Alcover, Dec 28 2021, after Alois P. Heinz *)
  • PARI
    a(n)=-vecmin(vector(n*(n+1)/2,i,polcoeff(prod(k=1,n,1-x^k),i))) \\ Benoit Cloitre, Sep 12 2003

Extensions

More terms from Benoit Cloitre, Sep 12 2003
Further terms from Sascha Kurz, Sep 22 2003
Previous Showing 11-20 of 51 results. Next