A087637 Erroneous version of A052458.
1, 0, 0, 2, 2, 0, 0, 115, 41, 0, 961
Offset: 1
Keywords
References
- M. Kraitchik, Mathematical Recreations, 1942, see Section 7.10.
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.
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.
$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 *)
The magic square is: [16132 130 16381 127 16128 ... 11854 4301 12111 4148 12210] [ 128 16382 129 16131 388 ... 4402 12209 4147 12112 4302] [16002 260 15999 509 16254 ... 12240 4431 11981 4530 11828] [ 510 16000 259 16001 2 ... 4276 11827 4529 11982 4432] [ 257 16003 512 15998 253 ... 4175 11984 4430 11825 4531] ... ... ... ... ... ... ... ... ... ... ... [ 4642 11684 4831 11613 5086 ... 7496 9159 7237 9018 7356] [ 4829 11615 4644 11682 4897 ... 7611 9020 7354 9157 7239] [11681 4643 11616 4830 11357 ... 8903 7240 9158 7353 9019] [ 4959 11485 5026 11300 4771 ... 7225 8890 7484 8775 7621] [11299 5025 11486 4960 11743 ... 9029 7622 8776 7483 8889]
Comments