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-10 of 22 results. Next

A052456 Number of magic series of order n.

Original entry on oeis.org

1, 1, 2, 8, 86, 1394, 32134, 957332, 35154340, 1537408202, 78132541528, 4528684996756, 295011186006282, 21345627856836734, 1698954263159544138, 147553846727480002824, 13888244935445960871352, 1408407905312396429259944, 153105374581396386625831530
Offset: 0

Views

Author

Keywords

Comments

Henry Bottomley's narrowing gap could be confirmed for 2 < n <= 64. - Walter Trump, Jan 21 2005
A new algorithm was found by Robert Gerbicz. Now the enumeration of magic series of orders greater than 100 is possible. - Walter Trump, May 05 2006

Examples

			a(3) = 8 since a magic square of order 3 would require a row sum of 15=(1+2+...+9)/3 and there are 8 ways of writing 15 as the sum of three distinct positive numbers up to 9: 1+5+9, 1+6+8, 2+4+9, 2+5+8, 2+6+7, 3+4+8, 3+5+7, 4+5+6.
		

References

  • M. Kraitchik, Magic Series. Section 7.13.3 in Mathematical Recreations, New York, W. W. Norton, pp. 143 and 183-186, 1942.

Crossrefs

Cf. A007785, A052457, A052458. A100568 is the same sequence times n!.
Main diagonal of A204459. - Alois P. Heinz, Jan 18 2012

Programs

  • Mathematica
    $RecursionLimit = 1000; b[n_, i_, t_] /; i < t || n < t*((t + 1)/2) || n > t*((2*i - t + 1)/2) = 0; b[0, , ] = 1; b[n_, i_, t_] := b[n, i, t] = b[n, i - 1, t] + If[n < i, 0, b[n - i, i - 1, t - 1]]; a[, 0] = 1; a[0, ] = 0; a[n_, k_] :=  With[{s = k*(k*n + 1)}, If[Mod[s, 2] == 1, 0, b[s/2, k*n, k]]]; a[n_] := a[n] = a[n, n]; Table[Print[a[n]]; a[n], {n, 0, 18}] (* Jean-François Alcover, Aug 15 2013, after Alois P. Heinz *)

Formula

a(n) = A067059(n, n*(n-1)) = r(n, n*(n-1), n^2*(n-1)/2) where r(n, m, k) is a restricted partition function giving the number of partitions of k into at most n positive parts each no more than m. - Henry Bottomley, Feb 25 2002.
It seems a(n) (at least for 2A068606 and assuming the peak of a normal distribution = 1/sqrt(variance*2*Pi) - Henry Bottomley, Feb 25 2002.
a(n) ~ sqrt(3) * exp(n-1/2) * n^(n-3) / Pi. - Vaclav Kotesovec, Sep 05 2014

Extensions

Edited and ten more terms from Henry Bottomley, Feb 16 2002
Terms through a(36) added to attached web page, Feb 04 2005

A063074 Number of partitions of 2n^2 whose Ferrers-plot fits within a 2n X 2n box; number of ways to cut a 2n X 2n chessboard into two equal-area pieces along a non-descending line from lower left to upper right.

Original entry on oeis.org

1, 2, 8, 58, 526, 5448, 61108, 723354, 8908546, 113093022, 1470597342, 19499227828, 262754984020, 3589093760726, 49596793134484, 692260288169282, 9747120868919060, 138298900243896166, 1975688102624819336, 28396056820503468894, 410363630540693436398
Offset: 0

Views

Author

Wouter Meeussen, Aug 03 2001

Keywords

Comments

Also the number of subsets of {1,...,4*n} containing exactly 2*n elements with total sum n*(4*n+1) (see also A060468 for a related sequence). This is of course the same as the number of partitions of n*(4*n+1) having 2*n distinct parts of length at most 4*n. This number is the coefficient of t^0 q^0 in Product_{k=1..4*n} (t*q^k + 1/(t*q^k)). - Roland Bacher, May 02 2002
A bijection with a dissection as above of the 2n X 2n checkerboard is given by subtracting 1,2,3,...,2n of the smallest, second-smallest, etc. element in the subset. Example for n=2: {1,2,7,8} (yields the checkerboard partition {1-1,2-2,7-3,8-4}={0,0,4,4}), {1,3,6,8} (yields {1-1,3-2,6-3,8-4}={0,1,3,4}), {1,4,5,8} (yields {0,2,2,4}), {1,4,6,7} (yields {0,2,3,3}), {3,4,5,6} (yields {2,2,2,2}), {2,4,5,7} (yields {1,2,2,3}), {2,3,6,7} (yields {1,1,3,3}), {2,3,5,8} (yields {1,1,2,4}).
Appears to be the number of random walks of length 4n, moves +/-1, starting and ending at 0 and with signed area 0 under the path. It would be nice to have a lower bound of the form a(n) > c*2^{4n}/n^d. - David_Mumford(AT)brown.edu, Jun 25 2003

Examples

			For a 4 X 4 board (n=2) the 8 partitions are (4,4,0,0), (4,3,1,0), (4,2,1,1), (4,2,2,0), (3,3,2,0), (3,3,1,1), (3,2,2,1), (2,2,2,2).
		

Crossrefs

Bisection of row n=2 of A204459. - Alois P. Heinz, Jan 18 2012

Programs

  • Maple
    b:= proc(n, i, t) option remember;
          `if`(it*(2*i-t+1)/2, 0,
          `if`(n=0, 1, b(n, i-1, t) +`if`(n b(n*(4*n+1), 4*n, 2*n):
    seq(a(n), n=0..25);  # Alois P. Heinz, Jan 18 2012
  • Mathematica
    Table[ Length@Select[ IntegerPartitions[ 2n^2 ], Length[ # ] <= 2n && First[ # ] <= 2n& ], {n, 1, 5} ] or faster: Table[ T[ 2n^2, 2n, 2n ], {n, 0, 24} ] with T[ m, a, b ] as defined in A047993.
    (* second program: *)
    b[n_, i_, t_] := b[n, i, t] =  If[i < t || n < t (t + 1)/2 || n > t (2i - t + 1)/2, 0, If[n == 0, 1, b[n, i - 1, t] + If[n < i, 0, b[n - i, i - 1, t - 1]]]]; a[n_] := b[n (4n + 1), 4n, 2n]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Aug 29 2016, after Alois P. Heinz *)

Formula

a(n) = A029895(2n) = A067059(2n, 2n) = A107110(2n, 2n^2). a(n) seems to be close to (sqrt(75)/Pi)*16^n/(20n^2+6n+1). - Henry Bottomley, May 12 2005

Extensions

More terms from Alois P. Heinz, Jan 18 2012

A109655 Number of partitions of n^2 into up to n parts each no more than 2n, or of n(3n+1)/2 into exactly n distinct parts each no more than 3n.

Original entry on oeis.org

1, 1, 3, 8, 33, 141, 676, 3370, 17575, 94257, 517971, 2900900, 16509188, 95220378, 555546058, 3273480400, 19456066175, 116521302221, 702567455381, 4261765991164, 25992285913221, 159303547578873, 980701254662294, 6061894625462492, 37609015174472628
Offset: 0

Views

Author

Henry Bottomley, Aug 05 2005

Keywords

Examples

			a(3) = 8 since 3^2=9 can be partitioned into 3+3+3, 4+3+2, 4+4+1, 5+4, 5+3+1, 5+2+2, 6+3, or 6+2+1, while 3*(3*3+1)/2=15 can be partitioned into 6+5+4, 7+5+3, 7+6+2, 8+6+1, 8+5+2, 8+4+3, 9+5+1, or 9+4+2.
		

Crossrefs

Cf. A161407. - Reinhard Zumkeller, Jun 10 2009
Row n=3 of A204459. - Alois P. Heinz, Jan 18 2012

Programs

  • Maple
    b:= proc(n, i, t) option remember;
          `if`(it*(2*i-t+1)/2, 0,
          `if`(n=0, 1, b(n, i-1, t) +`if`(n b(n*(3*n+1)/2, 3*n, n):
    seq(a(n), n=0..20);  # Alois P. Heinz, Jan 18 2012
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[it*(2*i-t+1)/2, 0, If[n == 0, 1, b[n, i-1, t] + If[nJean-François Alcover, Oct 05 2015, after Alois P. Heinz *)

Formula

a(n) = A067059(n,2n) = A067059(2n,n).
Slightly less than but close to (27/4)^n*sqrt(3)/(2*Pi*n^2).

Extensions

More terms from Alois P. Heinz, Jan 18 2012

A202261 Number of n-element subsets that can be chosen from {1,2,...,2*n} having element sum n^2.

Original entry on oeis.org

1, 1, 1, 3, 7, 18, 51, 155, 486, 1555, 5095, 17038, 57801, 198471, 689039, 2415043, 8534022, 30375188, 108815273, 392076629, 1420064031, 5167575997, 18885299641, 69287981666, 255121926519, 942474271999, 3492314839349, 12977225566680, 48349025154154
Offset: 0

Views

Author

Alois P. Heinz, Jan 20 2012

Keywords

Comments

a(n) is the number of partitions of n^2 into n distinct parts <= 2*n.
Taking the complement of each set, a(n) is also the number of partitions of n^2+n into n distinct parts <= 2*n. - Franklin T. Adams-Watters, Jan 20 2012
Also the number of partitions of n*(n+1)/2 into at most n parts of size at most n. a(4) = 7: 433, 442, 3322, 3331, 4222, 4321, 4411. - Alois P. Heinz, May 31 2020

Examples

			a(0) = 1: {}.
a(1) = 1: {1}.
a(2) = 1: {1,3}.
a(3) = 3: {1,2,6}, {1,3,5}, {2,3,4}.
a(4) = 7: {1,2,5,8}, {1,2,6,7}, {1,3,4,8}, {1,3,5,7}, {1,4,5,6}, {2,3,4,7},{2,3,5,6}.
		

Crossrefs

Column k=1 of A185282.

Programs

  • Maple
    b:= proc(n, i, t) option remember;
          `if`(it*(2*i-t+1)/2, 0,
          `if`(n=0, 1, b(n, i-1, t) +`if`(n b(n^2, 2*n, n):
    seq(a(n), n=0..30);
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[it*(2*i-t+1)/2, 0, If[n == 0, 1, b[n, i-1, t] + If[nJean-François Alcover, Feb 05 2015, after Alois P. Heinz *)

Formula

a(n) ~ sqrt(3) * 4^n / (Pi * n^2). - Vaclav Kotesovec, Sep 10 2014

A241810 Number of balanced orbitals over n sectors.

Original entry on oeis.org

1, 1, 0, 0, 2, 6, 0, 6, 8, 36, 0, 88, 58, 376, 0, 1096, 526, 4476, 0, 14200, 5448, 57284, 0, 190206, 61108, 764812, 0, 2615268, 723354, 10499504, 0, 36677626, 8908546, 147110276, 0, 522288944, 113093022
Offset: 0

Views

Author

Peter Luschny, Apr 29 2014

Keywords

Comments

For the combinatorial definitions see A232500. An orbital is balanced if its integral is 0. The integral of an orbital w over n sectors is Sum_{k=1..n} Sum_{i=1..k} w(i) where w(i) are the jumps of the orbital represented by -1, 0, 1.

Crossrefs

Programs

  • Mathematica
    np[z_]:=Module[{i,j},For[i=Length[z],i>1&&z[[i-1]]>=z[[i]],i--];For[j=Length[z],z[[j]]<=z[[i-1]],j--];Join[Take[z,i-2],{z[[j]]},Reverse[Drop[ReplacePart[z,z[[i-1]],j],i-1]]]];o=Table[1,{16}];
    n=0;f=0;Print[1];Print[1];While[n<16,n++;f=1-f;If[OddQ[f*n],Print[0],p=Join[-Take[o,n],{f},Take[o,n-f]];c=0;Do[If[Accumulate[Accumulate[p]][[-1]]==0,c++];p=np[p],{(2*n+1-f)!/(2*n!^2)}];Print[2*c]];n=n-f]
    (* Hans Havermann, May 10 2014 *)
  • Sage
    def A241810(n):
        if n == 0: return 1
        A = 0
        T = [0] if is_odd(n) else []
        for i in (1..n//2):
            T.append(-1); T.append(1)
        for p in Permutations(T):
            P = 0; S = 0
            for k in (0..n-1):
                P += p[k]; S += P
            if S == 0: A += 1
        return A
    [A241810(n) for n in (0..32)]

Formula

a(2*n) = A204459(2, n).
a(2*n+1) = A242087(n).
a(4*n) = A063074(n) = A029895(2*n) = A067059(2*n, 2*n).
a(4*n+2) = 0 for all n (proved by H. Havermann).

Extensions

More terms from Hans Havermann, May 10 2014
a(35), a(36) from Hans Havermann, May 23 2014

A186730 Number of n-element subsets that can be chosen from {1,2,...,2*n^2} having element sum n^3.

Original entry on oeis.org

1, 1, 3, 36, 785, 26404, 1235580, 74394425, 5503963083, 484133307457, 49427802479445, 5750543362215131, 751453252349649771, 109016775078856564392, 17391089152542558703435, 3026419470005398093836960, 570632810506646981058828349, 115900277419940965862120360831
Offset: 0

Views

Author

Alois P. Heinz, Jan 21 2012

Keywords

Comments

a(n) is the number of partitions of n^3 into n distinct parts <= 2*n^2.

Examples

			a(0) = 1: {}.
a(1) = 1: {1}.
a(2) = 3: {1,7}, {2,6}, {3,5}.
		

Crossrefs

Column k=2 of A185282.

Programs

  • Maple
    b:= proc(n, i, t) option remember;
          `if`(it*(2*i-t+1)/2, 0,
          `if`(n=0, 1, b(n, i-1, t) +`if`(n b(n^3, 2*n^2, n):
    seq(a(n), n=0..12);
  • Mathematica
    $RecursionLimit = 2000;
    b[n_, i_, t_] := b[n, i, t] = If[it (2i-t+1)/2, 0, If[n==0, 1, b[n, i-1, t] + If[nJean-François Alcover, Dec 05 2020, after Alois P. Heinz *)

A204460 Number of 2*n-element subsets that can be chosen from {1,2,...,8*n} having element sum n*(8*n+1).

Original entry on oeis.org

1, 4, 86, 3486, 178870, 10388788, 652694106, 43304881124, 2990752400778, 212997373622366, 15542763534960598, 1156764114321375362, 87507330113965391948, 6711208401368504338646, 520758394504342278328914, 40818243590325732399837872, 3227693268242421225516534768
Offset: 0

Views

Author

Alois P. Heinz, Jan 18 2012

Keywords

Comments

a(n) is the number of partitions of n*(8*n+1) into 2*n distinct parts <=8*n.

Examples

			a(1) = 4 because there are 4 2-element subsets that can be chosen from {1,2,...,8} having element sum 9: {1,8}, {2,7}, {3,6}, {4,5}.
		

Crossrefs

Bisection of row n=4 of A204459.

Programs

  • Maple
    b:= proc(n, i, t) option remember;
          `if`(it*(2*i-t+1)/2, 0,
          `if`(n=0, 1, b(n, i-1, t) +`if`(n b(n*(8*n+1), 8*n, 2*n):
    seq(a(n), n=0..15);
  • Mathematica
    b[n_, i_, t_] /; it(2i-t+1)/2 = 0; b[0, , ] = 1;
    b[n_, i_, t_] := b[n, i, t] = b[n, i-1, t] + If[nJean-François Alcover, Dec 07 2020, after Alois P. Heinz *)

A204461 Number of n-element subsets that can be chosen from {1,2,...,5*n} having element sum n*(5*n+1)/2.

Original entry on oeis.org

1, 1, 5, 25, 177, 1394, 11963, 108108, 1016737, 9853759, 97809616, 989878326, 10180316707, 106124695130, 1119148085092, 11920389375524, 128077285062639, 1386689101261013, 15115933170815361, 165776800325379769, 1828006462946421194, 20256667860779557632
Offset: 0

Views

Author

Alois P. Heinz, Jan 18 2012

Keywords

Comments

a(n) is the number of partitions of n*(5*n+1)/2 into n distinct parts <=5*n.

Examples

			a(2) = 5 because there are 5 2-element subsets that can be chosen from {1,2,...,10} having element sum 11: {1,10}, {2,9}, {3,8}, {4,7}, {5,6}.
		

Crossrefs

Row n=5 of A204459.

Programs

  • Maple
    b:= proc(n, i, t) option remember;
          `if`(it*(2*i-t+1)/2, 0,
          `if`(n=0, 1, b(n, i-1, t) +`if`(n b(n*(5*n+1)/2, 5*n, n):
    seq(a(n), n=0..20);
  • Mathematica
    b[n_, i_, t_] /; it(2i-t+1)/2 = 0; b[0, , ] = 1;
    b[n_, i_, t_] := b[n, i, t] = b[n, i-1, t] + If[nJean-François Alcover, Dec 07 2020, after Alois P. Heinz *)

A204463 Number of n-element subsets that can be chosen from {1,2,...,7*n} having element sum n*(7*n+1)/2.

Original entry on oeis.org

1, 1, 7, 50, 519, 5910, 73294, 957332, 13011585, 182262067, 2615047418, 38257201350, 568784501596, 8571868074560, 130687117401934, 2012485947249822, 31262279693472267, 489374243181858825, 7712880007117038531, 122301036027089010734, 1949904188227477978314
Offset: 0

Views

Author

Alois P. Heinz, Jan 18 2012

Keywords

Comments

a(n) is the number of partitions of n*(7*n+1)/2 into n distinct parts <=7*n.

Examples

			a(2) = 7 because there are 7 2-element subsets that can be chosen from {1,2,...,14} having element sum 15: {1,14}, {2,13}, {3,12}, {4,11}, {5,10}, {6,9}, {7,8}.
		

Crossrefs

Row n=7 of A204459.

Programs

  • Maple
    b:= proc(n, i, t) option remember;
          `if`(it*(2*i-t+1)/2, 0,
          `if`(n=0, 1, b(n, i-1, t) +`if`(n b(n*(7*n+1)/2, 7*n, n):
    seq(a(n), n=0..20);
  • Mathematica
    b[n_, i_, t_] /; it(2i-t+1)/2 = 0; b[0, , ] = 1;
    b[n_, i_, t_] := b[n, i, t] = b[n, i-1, t] + If[nJean-François Alcover, Dec 07 2020, after Alois P. Heinz *)

A204466 Number of 2*n-element subsets that can be chosen from {1,2,...,20*n} having element sum n*(20*n+1).

Original entry on oeis.org

1, 10, 1588, 479632, 181913856, 78132541528, 36324664278320, 17841778519299678, 9124496750611111054, 4812920777714763364122, 2601500672087054002816858, 1434306387533099461310390376, 803846503605741741601245431730, 456755915371658053029595187998278
Offset: 0

Views

Author

Alois P. Heinz, Jan 18 2012

Keywords

Comments

a(n) is the number of partitions of n*(20*n+1) into 2*n distinct parts <=20*n.

Examples

			a(1) = 10 because there are 10 2-element subsets that can be chosen from {1,2,...,20} having element sum 21: {1,20}, {2,19}, {3,18}, {4,17}, {5,16}, {6,15}, {7,14}, {8,13}, {9,12}, {10,11}.
		

Crossrefs

Bisection of row n=10 of A204459.

Programs

  • Maple
    b:= proc(n, i, t) option remember;
          `if`(it*(2*i-t+1)/2, 0,
          `if`(n=0, 1, b(n, i-1, t) +`if`(n b(n*(20*n+1), 20*n, 2*n):
    seq(a(n), n=0..10);
  • Mathematica
    b[n_, i_, t_] /; it(2i-t+1)/2 = 0; b[0, , ] = 1;
    b[n_, i_, t_] := b[n, i, t] = b[n, i-1, t] + If[nJean-François Alcover, Dec 07 2020, after Alois P. Heinz *)
Showing 1-10 of 22 results. Next