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 32 results. Next

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

A362046 Number of nonempty subsets of {1..n} with mean n/2.

Original entry on oeis.org

0, 0, 1, 1, 3, 3, 9, 8, 25, 23, 75, 68, 235, 213, 759, 695, 2521, 2325, 8555, 7941, 29503, 27561, 103129, 96861, 364547, 344003, 1300819, 1232566, 4679471, 4449849, 16952161, 16171117, 61790441, 59107889, 226451035, 217157068, 833918839, 801467551, 3084255127
Offset: 0

Views

Author

Gus Wiseman, Apr 12 2023

Keywords

Examples

			The a(2) = 1 through a(7) = 8 subsets:
  {1}  {1,2}  {2}      {1,4}      {3}          {1,6}
              {1,3}    {2,3}      {1,5}        {2,5}
              {1,2,3}  {1,2,3,4}  {2,4}        {3,4}
                                  {1,2,6}      {1,2,4,7}
                                  {1,3,5}      {1,2,5,6}
                                  {2,3,4}      {1,3,4,6}
                                  {1,2,3,6}    {2,3,4,5}
                                  {1,2,4,5}    {1,2,3,4,5,6}
                                  {1,2,3,4,5}
		

Crossrefs

Using range 0..n gives A070925.
Including the empty set gives A133406.
Even bisection is A212352.
For median instead of mean we have A361801, the doubling of A079309.
A version for partitions is A361853, for median A361849.
A000980 counts nonempty subsets of {1..2n-1} with mean n.
A007318 counts subsets by length.
A067538 counts partitions with integer mean, strict A102627.
A231147 appears to count subsets by median, full-steps A013580.
A327475 counts subsets with integer mean, A000975 integer median.
A327481 counts subsets by integer mean.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],Mean[#]==n/2&]],{n,0,15}]

Formula

a(n) = (A070925(n) - 1)/2.
a(n) = A133406(n) - 1.
a(2n) = A212352(n) = A000980(n)/2 - 1.

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

A156181 Number of solutions to e(1)*1 + e(2)*2 + ... + e(n)*n = e(-1)*1 + e(-2)*2 + ... + e(-n)*n, where e(j) are from {-1,0,1}, j=-n,...,n.

Original entry on oeis.org

1, 3, 13, 65, 403, 2669, 18759, 136477, 1020373, 7785741, 60395165, 474817833, 3775005799, 30298719855, 245167429681, 1997854542163, 16381233095985, 135050690760831, 1118800428892925, 9308791880014333, 77755512086256649
Offset: 0

Views

Author

Steven Finch, Feb 05 2009

Keywords

Comments

a(n) = coefficient of x^(n*(n+1)) in the polynomial Product_{k=1..n} (1 + x^k + x^(2*k))^2, and is the maximal such coefficient as well.

Crossrefs

Programs

  • Mathematica
    Table[Coefficient[Expand[Product[(1 + x^k + x^(2*k))^2, {k, 1, n}]],x, n*(n + 1)], {n, 0, 20}]

Formula

a(n) is the constant term in expansion of Product_{k=1..n} (x^k + 1 + 1/x^k)^2. - Ilya Gutkovskiy, Jan 22 2024

A245134 T(n,k)=Number of length n 0..k arrays least squares fitting to a zero slope straight line, with a single point taken as having zero slope.

Original entry on oeis.org

2, 3, 2, 4, 3, 4, 5, 4, 9, 4, 6, 5, 16, 9, 8, 7, 6, 25, 22, 39, 8, 8, 7, 36, 41, 112, 43, 20, 9, 8, 49, 66, 275, 172, 195, 18, 10, 9, 64, 107, 552, 505, 1064, 243, 52, 11, 10, 81, 158, 1029, 1248, 4005, 1742, 1209, 48, 12, 11, 100, 219, 1728, 2687, 11856, 8193, 11664, 1539
Offset: 1

Views

Author

R. H. Hardin, Jul 12 2014

Keywords

Comments

Table starts
..2....3.....4......5......6.......7.......8........9.......10........11
..2....3.....4......5......6.......7.......8........9.......10........11
..4....9....16.....25.....36......49......64.......81......100.......121
..4....9....22.....41.....66.....107.....158......219......304.......403
..8...39...112....275....552....1029....1728.....2781.....4200......6171
..8...43...172....505...1248....2687....5220.....9385....15868.....25539
.20..195..1064...4005..11856...29813...66256...134091...252060....446193
.18..243..1742...8193..29182...85529..217336...494943..1033716...2012883
.52.1209.11664..68855.294024.1006089.2920784..7483887.17365380..37197259
.48.1539.19976.147117.754712.3011889.9995864.28810117.74285448.175024363

Examples

			Some solutions for n=7 k=4
..3....1....2....0....4....0....2....3....0....4....3....1....0....2....4....1
..1....4....0....0....0....1....1....0....3....0....3....3....2....1....0....3
..2....4....2....4....4....2....3....0....4....2....0....1....3....0....4....0
..3....2....4....0....1....2....4....4....3....3....2....4....1....2....4....1
..2....3....3....1....2....1....3....0....4....0....4....4....0....1....0....0
..1....3....1....0....1....0....1....3....0....1....1....3....2....2....2....0
..3....2....1....1....4....1....2....1....2....4....3....0....1....1....4....3
		

Crossrefs

Column 1 is A222955, terms 1,3,5... are A000980
Column 2 is A223743
Column 3 is A223819
Row 1 is A000027(n+1)
Row 2 is A000027(n+1)
Row 3 is A000290(n+1)
Row 4 is A200155

Formula

Empirical for row n:
n=1: a(n) = 2*a(n-1) -a(n-2)
n=2: a(n) = 2*a(n-1) -a(n-2)
n=3: a(n) = 3*a(n-1) -3*a(n-2) +a(n-3)
n=4: a(n) = 2*a(n-1) -a(n-2) +2*a(n-3) -4*a(n-4) +2*a(n-5) -a(n-6) +2*a(n-7) -a(n-8)
n=5: a(n) = 2*a(n-1) +2*a(n-2) -6*a(n-3) +6*a(n-5) -2*a(n-6) -2*a(n-7) +a(n-8)
n=6: [order 18]
n=7: [order 16]

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

A133406 Half the number of ways of placing up to n pawns on a length n chessboard row so that the row balances at its middle.

Original entry on oeis.org

1, 1, 2, 2, 4, 4, 10, 9, 26, 24, 76, 69, 236, 214, 760, 696, 2522, 2326, 8556, 7942, 29504, 27562, 103130, 96862, 364548, 344004, 1300820, 1232567, 4679472, 4449850, 16952162, 16171118, 61790442, 59107890, 226451036, 217157069, 833918840
Offset: 1

Views

Author

R. H. Hardin, Nov 24 2007

Keywords

Comments

Odd-indexed terms are A047653.
Also the number of subsets of {1..n-1} that are empty or have mean (n-1)/2. - Gus Wiseman, Apr 23 2023

Examples

			From _Gus Wiseman_, Apr 23 2023: (Start)
The a(1) = 1 through a(8) = 9 subsets:
  {}  {}  {}   {}     {}       {}         {}           {}
          {1}  {1,2}  {2}      {1,4}      {3}          {1,6}
                      {1,3}    {2,3}      {1,5}        {2,5}
                      {1,2,3}  {1,2,3,4}  {2,4}        {3,4}
                                          {1,2,6}      {1,2,4,7}
                                          {1,3,5}      {1,2,5,6}
                                          {2,3,4}      {1,3,4,6}
                                          {1,2,3,6}    {2,3,4,5}
                                          {1,2,4,5}    {1,2,3,4,5,6}
                                          {1,2,3,4,5}
(End)
		

Crossrefs

For median instead of mean we have A361801 + 1, the doubling of A024718.
Not counting the empty set gives A362046 (shifted left).
A007318 counts subsets by length, A327481 by integer mean.
A047653 counts subsets of {1..2n} with mean n, nonempty A212352.
A070925 counts subsets of {1..2n-1} with mean n, nonempty A000980.
A327475 counts subsets with integer mean, nonempty A051293.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],Length[#]==0||Mean[#]==n/2&]],{n,0,10}] (* Gus Wiseman, Apr 23 2023 *)
  • PARI
    a(n) = {polcoef(prod(k=1, n, 1 + 'x^(2*k-n-1)), 0)/2} \\ Andrew Howroyd, Jan 07 2023

Formula

From Gus Wiseman, Apr 23 2023: (Start)
a(2n+1) = A000980(n)/2 = A047653(n).
a(n) = A362046(n-1) + 1.
(End)

A212352 Row sums of A047997.

Original entry on oeis.org

0, 1, 3, 9, 25, 75, 235, 759, 2521, 8555, 29503, 103129, 364547, 1300819, 4679471, 16952161, 61790441, 226451035, 833918839, 3084255127, 11451630043, 42669225171, 159497648599, 597950875255, 2247724108771, 8470205600639
Offset: 0

Views

Author

N. J. A. Sloane, May 16 2012

Keywords

Comments

Also the number of nonempty subsets of {1..2n} with mean n, even bisection of A362046. - Gus Wiseman, Apr 15 2023

Examples

			From _Gus Wiseman_, Apr 15 2023: (Start)
The a(1) = 1 through a(3) = 9 subsets:
  {1}  {2}      {3}
       {1,3}    {1,5}
       {1,2,3}  {2,4}
                {1,2,6}
                {1,3,5}
                {2,3,4}
                {1,2,3,6}
                {1,2,4,5}
                {1,2,3,4,5}
(End)
		

Crossrefs

Equals A047653(n) - 1.
Row sums of A047997.
For median instead of mean we have A079309, bisection of A361801.
Even bisection of A362046, zero-based version A070925.
A000980 counts nonempty subsets of {1..2n-1} with mean n.
A007318 counts subsets by length.
A327475 counts subsets with integer mean.
A327481 counts subsets by mean.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[2n]],Mean[#]==n&]],{n,0,6}] (* Gus Wiseman, Apr 15 2023 *)

Formula

From Gus Wiseman, Apr 15 2023: (Start)
a(n) = A000980(n)/2 - 1.
a(n) = A047653(n) - 1.
a(n) = A133406(2n+1) - 1.
a(n) = A362046(2n).
(End)

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

A141000 Numbers k for which there is a solution to the Jumping Grasshopper game.

Original entry on oeis.org

0, 1, 4, 9, 13, 16, 20, 21, 24, 25, 28, 29, 32, 33, 36, 37, 40, 41, 44, 45, 48, 49, 52, 53, 56, 57, 60, 61, 64, 65, 68, 69, 72, 73, 76, 77, 80, 81, 84, 85, 88, 89, 92, 93, 96, 97, 100, 101, 104, 105, 108, 109, 112, 113, 116, 117, 120, 121, 124, 125, 128, 129, 132, 133
Offset: 1

Views

Author

Ivan Moscovich (i.moscovich2(AT)chello.nl), Jul 07 2008

Keywords

Comments

That is, numbers k such that there is a choice of signs s_1, s_2, ..., s_k (each +1 or -1) so that (i) 0 <= Sum_{i = 1..j } i*s_i <= k for all 1 <= j <= k-1 and (ii) Sum_{i = 1..k } i*s_i = k. (This forces s_1 = s_2 = s_k = +1.)
It has been shown by Dick Hess and Benji Fisher that a number k >= 20 is in the sequence iff k == 0 or 1 (mod 4). (For a proof see the Applegate link.) It is easy to see that k == 0 or 1 (mod 4) is a necessary condition.
Further comments from David Applegate and N. J. A. Sloane, Jul 14 2008: (Start)
An obvious greedy algorithm (working backwards) does the following: For j = k, k-1, ..., 1, let target_j = k - Sum_{i = j+1..k} i * s_i and set s_j = +1 if target_j >= j and s_j = -1 otherwise. This works unless we hit one of five exceptions, in which we must set s_j = -1 instead of +1.
The five exceptions are when (j, target_j) is (5,5), (6,9), (7,14), (8,8), or (9,13). The algorithm also works for the more general case when the target total target_k is different from k, with the additional exception of (8,20). (End)

Examples

			4 is a member because we can take s_1 = s_2 = s_4 = +1, s_3 = -1. Note in particular that 1 + 2 -3 + 4 = 4. (See the illustration.)
		

References

  • Ivan Moscovich, "MATH - Isn't It Beautiful!", 2009.

Crossrefs

Programs

  • Mathematica
    {0, 1, 4, 9, 13, 16}~Join~LinearRecurrence[{1, 1, -1}, {20, 21, 24}, 58] (* Jean-François Alcover, Nov 20 2019 *)
    LinearRecurrence[{1,1,-1},{0,1,4,9,13,16,20,21,24},70] (* Harvey P. Dale, Mar 22 2025 *)
  • Tcl
    # See the notes by D. Applegate above.

Formula

From Colin Barker, May 19 2013: (Start)
a(n) = (11 - (-1)^n + 4*n)/2 for n > 6.
a(n) = a(n-1) + a(n-2) - a(n-3) for n > 9.
G.f.: -x^2*(x^7+2*x^6+2*x^4-x^3-4*x^2-3*x-1) / ((x-1)^2*(x+1)). (End)
Previous Showing 11-20 of 32 results. Next