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-6 of 6 results.

A108579 Number of symmetry classes of 3 X 3 magic squares (with distinct positive entries) having magic sum 3n.

Original entry on oeis.org

0, 0, 0, 0, 1, 3, 4, 7, 10, 13, 17, 22, 26, 32, 38, 44, 51, 59, 66, 75, 84, 93, 103, 114, 124, 136, 148, 160, 173, 187, 200, 215, 230, 245, 261, 278, 294, 312, 330, 348, 367, 387, 406, 427, 448, 469, 491, 514, 536, 560, 584, 608, 633, 659, 684, 711, 738, 765, 793, 822, 850
Offset: 1

Views

Author

Thomas Zaslavsky, Jun 11 2005

Keywords

Comments

A magic square has distinct positive integers in its cells, whose sum is the same (the "magic sum") along any row, column, or main diagonal.
a(n) is given by a quasipolynomial of period 6.
It appears that A108579(n) is the number of ordered triples (w,x,y) with components all in {1,...,n} and w+n=2x+3y, as in the Mathematica section. For related sequences, see A211422. - Clark Kimberling, Apr 15 2012

Examples

			a(5) = 1 because there is a unique 3 X 3 magic square, up to symmetry, using the first 9 positive integers.
		

Crossrefs

Nonzero entries are the second differences of A055328.

Programs

  • Mathematica
    (* This program generates a sequence described in the Comments section *)
    t[n_] := t[n] = Flatten[Table[-w^2 + x*y + n, {w, 1, n}, {x, 1, n}, {y, 1, n}]]
    c[n_] := Count[t[n], 0]
    t = Table[c[n], {n, 1, 80}]  (* A211506 *)
    (* Clark Kimberling, Apr 15 2012 *)

Formula

a(n) = floor((1/4)*(n-2)^2)-floor((1/3)*(n-1)). - Mircea Merca, Oct 08 2013
G.f.: x^5*(1+2*x)/((1-x)*(1-x^2)*(1-x^3)).

Extensions

Edited by N. J. A. Sloane, Oct 04 2010

A108576 Number of 3 X 3 magic squares (with distinct positive entries) having all entries < n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 16, 40, 64, 96, 128, 184, 240, 320, 400, 504, 608, 744, 880, 1056, 1232, 1440, 1648, 1904, 2160, 2464, 2768, 3120, 3472, 3880, 4288, 4760, 5232, 5760, 6288, 6888, 7488, 8160, 8832, 9576, 10320, 11144, 11968, 12880, 13792, 14784, 15776
Offset: 1

Views

Author

Thomas Zaslavsky and Ralf Stephan, Jun 11 2005

Keywords

Comments

From Thomas Zaslavsky, Mar 12 2010: (Start)
A magic square has distinct positive integers in its cells, whose sum is the same (the "magic sum") along any row, column, or main diagonal.
a(n) is given by a quasipolynomial of period 12. (End)

Examples

			a(10) = 8 because there are 8 3 X 3 magic squares with distinct entries < 10 (they are the standard magic squares).
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{2, -1, 0, 1, -2, 2, -2, 1, 0, -1, 2, -1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 16, 40}, 60] (* Jean-François Alcover, Nov 12 2018 *)
    CoefficientList[Series[(8 x^10 (2 x^2 + 1)) / ((1 - x^6) (1 - x^4) (1 - x)^2), {x, 0, 60}], x] (* Vincenzo Librandi, Nov 12 2018 *)
  • PARI
    a(n)=1/6*(n^3-16*n^2+(76-3*(n%2))*n -[96,58,96,102,112,90,96,70,96,90,112,102][(n%12)+1])

Formula

G.f.: (8*x^10*(2*x^2+1)) / ((1-x^6)*(1-x^4)*(1-x)^2).
a(n) is given by a quasipolynomial of period 12.

Extensions

Edited by N. J. A. Sloane, Feb 05 2010

A108577 Number of symmetry classes of 3 X 3 magic squares (with distinct positive entries) having all entries < n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 5, 8, 12, 16, 23, 30, 40, 50, 63, 76, 93, 110, 132, 154, 180, 206, 238, 270, 308, 346, 390, 434, 485, 536, 595, 654, 720, 786, 861, 936, 1020, 1104, 1197, 1290, 1393, 1496, 1610, 1724, 1848, 1972, 2108, 2244, 2392, 2540, 2700, 2860
Offset: 1

Views

Author

Thomas Zaslavsky, Jun 11 2005

Keywords

Comments

A magic square has distinct positive integers in its cells, whose sum is the same (the "magic sum") along any row, column, or main diagonal. The symmetries are those of the square. - Thomas Zaslavsky, Mar 12 2010

Examples

			a(10) = 1 because there is only one symmetry type of 3 X 3 magic square with entries 1,...,9.
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{2, -1, 0, 1, -2, 2, -2, 1, 0, -1, 2, -1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 5}, 58] (* Mike Sheppard, Feb 04 2025 *)

Formula

G.f.: (x^10*(2*x^2+1)) / ((1-x^6)*(1-x^4)*(1-x)^2).
a(n) is given by a quasipolynomial of period 12.

A173546 Number of 3 X 3 semimagic squares with distinct positive values < n. In a semimagic squares the row and column sums must all be equal (the "magic sum").

Original entry on oeis.org

72, 288, 936, 2592, 5760, 11520, 20952, 35712, 57168, 88272, 131112, 189504, 265752, 365760, 492480, 653040, 851472, 1096416, 1392768, 1751904, 2178864, 2687184, 3283632, 3983760, 4794984, 5736528, 6816456, 8056224, 9466128
Offset: 10

Views

Author

Thomas Zaslavsky, Feb 21 2010

Keywords

Comments

a(n) is given by a quasipolynomial of degree 5 and period 60.

References

  • Matthias Beck and Thomas Zaslavsky, An enumerative geometry for magic and magilatin labellings, Annals of Combinatorics, 10 (2006), no. 4, pages 395-413. MR 2007m:05010. Zbl 1116.05071.

Crossrefs

A173547 counts the same squares by magic sum.

Formula

G.f.: 72 * x^2/(1-x)^2 * { x^5/[(1-x)^3*(1-x^2)] - 2x^5/[(1-x)*(1-x^2)^2] - x^5/[(1-x)^2*(1-x^3)] - 2x^6/[(1-x)*(1-x^2)*(1-x^3)] - x^6/(1-x^2)^3 - x^7/[(1-x^2)^2*(1-x^3)] + x^5/[(1-x)*(1-x^4)] + 2x^5/[(1-x^2)*(1-x^3)] + 2x^6/[(1-x^2)*(1-x^4)] + x^6/(1-x^3)^2 + x^7/[(1-x^2)*(1-x^5)] + x^7/[(1-x^3)*(1-x^4)] + x^8/[(1-x^3)*(1-x^5)] - x^5/(1-x^5) }. - Thomas Zaslavsky, Mar 03 2010

A173547 Number of 3 X 3 semimagic squares with distinct positive values and magic sum n.

Original entry on oeis.org

72, 144, 288, 576, 864, 1440, 2088, 3024, 3888, 5904, 6984, 9432, 12168, 14904, 17928, 23832, 26784, 33048, 39672, 46584, 53640, 65592, 72504, 85248, 98928, 111816, 125208, 147528, 160632, 182808, 206424, 229176, 252648, 287928, 310752
Offset: 15

Views

Author

Thomas Zaslavsky, Feb 21 2010, Feb 24 2010, Mar 03 2010

Keywords

Comments

In a semimagic squares the row and column sums must all be equal to the magic sum. a(n) is given by a quasipolynomial of degree 4 and period 840.
a(15) is the first term because the values 1,...,9 make magic sum 15. [From Thomas Zaslavsky, Mar 03 2010]

References

  • Matthias Beck and Thomas Zaslavsky, An enumerative geometry for magic and magilatin labellings, Annals of Combinatorics, 10 (2006), no. 4, pages 395-413. MR 2007m:05010. Zbl 1116.05071.

Crossrefs

A173546 counts the same squares by upper bound on the entries. Cf. A108576, A108577, A108578, A108579, A173548, A173549.

Formula

G.f.: 72 * x^3/(1-x)^3 * { x^7/[(x-1)*(x^2-1)^3] + 2x^7/[(x-1)*(x^2-1)*(x^4-1)] + x^7/[(x-1)*(x^6-1)] + x^7/[(x^2-1)^2*(x^3-1)] + x^7/[(x^2-1)*(x^5-1)] + x^7/[(x^3-1)*(x^4-1)] + x^7/(x^7-1) + x^9/[(x-1)*(x^4-1)^2] + 2*x^9/[(x^2-1)*(x^3-1)*(x^4-1)] + 2*x^9/[(x^3-1)*(x^6-1)] + x^9/[(x^4-1)*(x^5-1)] + x^11/[(x^3-1)*(x^4-1)^2] + x^11/[(x^3-1)*(x^8-1)] + x^11/[(x^5-1)*(x^6-1)] + x^13/[(x^5-1)*(x^8-1)] }

A174256 Number of 3 X 3 reduced magic squares with distinct values and maximum value 2n; also, with magic sum 3n.

Original entry on oeis.org

0, 0, 0, 8, 16, 8, 24, 24, 24, 32, 40, 32, 48, 48, 48, 56, 64, 56, 72, 72, 72, 80, 88, 80, 96, 96, 96, 104, 112, 104, 120, 120, 120, 128, 136, 128, 144, 144, 144, 152, 160, 152, 168, 168, 168, 176, 184, 176, 192, 192, 192, 200, 208, 200, 216, 216, 216, 224, 232, 224
Offset: 1

Views

Author

Thomas Zaslavsky, Mar 14 2010

Keywords

Comments

In a reduced magic square the row, column, and two diagonal sums must all be equal (the "magic sum") and the minimum entry is 0. The maximum entry is necessarily even and = (2/3)*(magic sum).
a(n) is a quasipolynomial with period 6.
The second differences of A108576 are a(n/2) for even n and 0 for odd n. The first differences of A108578 are a(n).

Crossrefs

Programs

  • Mathematica
    Take[CoefficientList[Series[(8x^8 (2x^2+1))/((x^4-1)(x^6-1)),{x,0,120}],x],{1,-1,2}] (* Harvey P. Dale, Aug 07 2017 *)

Formula

a(n) = 8*A174257(n).
G.f.: 8*x^4 * (2*x+1) / ((x^2-1) * (x^3-1)). [amended by Georg Fischer, Apr 17 2020]
a(n) = 2*(6*n - 13 - 8*cos(2*n*Pi/3) - 3*cos(n*Pi))/3. - Wesley Ivan Hurt, Oct 04 2018
Showing 1-6 of 6 results.