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
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.
- M. Kraitchik, Magic Series. Section 7.13.3 in Mathematical Recreations, New York, W. W. Norton, pp. 143 and 183-186, 1942.
- T. D. Noe and Alois P. Heinz, Table of n, a(n) for n = 0..150 (from Gerbicz and Trump)
- H. Bottomley, Partition and composition calculator
- H. Bottomley and W. Trump, First 36 terms
- Walter Trump, Magic Squares.
- Eric Weisstein's World of Mathematics, Magic Series
- Eric Weisstein's World of Mathematics, Multimagic Series
- Robert Gerbicz, Walter Trump, First 150 terms
- Robert Gerbicz, C-program to generate the sequence
-
$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 *)
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
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).
-
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
-
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 *)
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
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.
-
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
-
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 *)
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
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}.
-
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);
-
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 *)
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
-
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 *)
-
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)]
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
a(0) = 1: {}.
a(1) = 1: {1}.
a(2) = 3: {1,7}, {2,6}, {3,5}.
-
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);
-
$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
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}.
-
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);
-
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
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}.
-
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);
-
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
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}.
-
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);
-
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
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}.
-
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);
-
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.
Comments