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-7 of 7 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

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.

A108578 Number of 3 X 3 magic squares with magic sum 3n.

Original entry on oeis.org

0, 0, 0, 0, 8, 24, 32, 56, 80, 104, 136, 176, 208, 256, 304, 352, 408, 472, 528, 600, 672, 744, 824, 912, 992, 1088, 1184, 1280, 1384, 1496, 1600, 1720, 1840, 1960, 2088, 2224, 2352, 2496, 2640, 2784, 2936, 3096, 3248, 3416, 3584, 3752, 3928, 4112, 4288
Offset: 1

Views

Author

Thomas Zaslavsky and Ralf Stephan, Jun 11 2005

Keywords

Comments

Contribution 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 6. (End)

Examples

			a(5) = 8 because there are 8 3 X 3 magic squares with entries 1,...,9 and magic sum 15.
		

Crossrefs

Equals 8 times the second differences of A055328.

Programs

  • Magma
    I:=[0,0,0,0,8,24]; [n le 6 select I[n] else Self(n-1)+Self(n-2)-Self(n-4)-Self(n-5)+Self(n-6): n in [1..60]]; // Vincenzo Librandi, Sep 01 2018
  • Mathematica
    LinearRecurrence[{1, 1, 0, -1, -1, 1}, {0, 0, 0, 0, 8, 24}, 50] (* Jean-François Alcover, Sep 01 2018 *)
    CoefficientList[Series[8 x^4 (1 + 2 x) / ((1 - x) (1 - x^2) (1 - x^3)), {x, 0, 50}], x] (* Vincenzo Librandi, Sep 01 2018 *)
  • PARI
    a(n)=(1/9)*(2*n^2-32*n+[144,78,120,126,96,102][(n%18)/3+1])
    
  • PARI
    x='x+O('x^99); concat(vector(4), Vec(8*x^5*(1+2*x)/((1-x)*(1-x^2)*(1-x^3)))) \\ Altug Alkan, Sep 01 2018
    

Formula

G.f.: [8*x^5*(1+2*x)] / [(1-x)*(1-x^2)*(1-x^3)].
a(n) = a(n-1) + a(n-2) - a(n-4) - a(n-5) + a(n-6). - Vincenzo Librandi, Sep 01 2018

Extensions

Edited by N. J. A. Sloane, Feb 05 2010
Corrected g.f. to account for previous change in parameter n from magic sum s to s/3; by Thomas Zaslavsky, Mar 12 2010

A174257 Number of symmetry classes 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, 1, 2, 1, 3, 3, 3, 4, 5, 4, 6, 6, 6, 7, 8, 7, 9, 9, 9, 10, 11, 10, 12, 12, 12, 13, 14, 13, 15, 15, 15, 16, 17, 16, 18, 18, 18, 19, 20, 19, 21, 21, 21, 22, 23, 22, 24, 24, 24, 25, 26, 25, 27, 27, 27, 28, 29, 28, 30, 30, 30, 31, 32, 31, 33, 33, 33, 34, 35, 34, 36, 36, 36, 37
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). The symmetries are those of the square.
a(n) is a quasipolynomial with period 6.
The second differences of A108577 are a(n/2) for even n and 0 for odd n. The first differences of A108579 are a(n/3).
For n>=3 equals a(n) the number of partitions of n-3 using parts 1 and 2 only, with distinct multiplicities. Example: a(7) = 3 because [2,2], [2,1,1], [1,1,1,1] are such partitions of 7-3=4. - T. Amdeberhan, May 13 2012
a(n) is equal to the number of partitions of n of length 3 with exactly two equal entries (see below example). - John M. Campbell, Jan 29 2016
a(k) + 2 =:t(k), k >= 1, based on sequence A300069, is used to obtain for 2^t(k)*O_{-k} integer coordinates in the quadratic number field Q(sqrt(3)), where O_{-k} is the center of a k-family of regular hexagons H_{-k} forming part of a discrete spiral. See the linked W. Lang paper, Lemma 5, and Table 7. - Wolfdieter Lang, Mar 30 2018
a(n) is equal to the number of incongruent isosceles triangles (excluding equilateral triangles) formed from the vertices of a regular n-gon. - Frank M Jackson, Oct 30 2022

Examples

			From _John M. Campbell_, Jan 29 2016: (Start)
For example, there are a(16)=7 partitions of 16 of length 3 with exactly two equal entries:
  (14,1,1) |- 16
  (12,2,2) |- 16
  (10,3,3) |- 16
   (8,4,4) |- 16
   (7,7,2) |- 16
   (6,6,4) |- 16
   (6,5,5) |- 16
(End)
		

Crossrefs

Programs

  • Maple
    seq(floor((n-1)/2)+floor((n-1)/3)-floor(n/3),n=1..100) # Mircea Merca, May 14 2013
  • Mathematica
    Rest@ CoefficientList[Series[x^4 (1 + 2 x)/((1 + x) (1 + x + x^2) (x - 1)^2), {x, 0, 76}], x] (* Michael De Vlieger, Jan 29 2016 *)
    Table[Length@Select[Length/@Union/@IntegerPartitions[n, {3}], # == 2 &], {n,
      1, 100}] (* Frank M Jackson, Oct 30 2022 *)
  • PARI
    concat(vector(3), Vec(x^4*(1+2*x) / ( (1+x)*(1+x+x^2)*(x-1)^2 ) + O(x^90))) \\ Michel Marcus, Jan 29 2016

Formula

G.f.: x^4*(1+2*x) / ( (1+x)*(1+x+x^2)*(x-1)^2 ).
a(n) = (1/8)*A174256(n).
a(n) = floor((n-1)/2) + floor((n-1)/3) - floor(n/3). - Mircea Merca, May 14 2013
a(n) = A300069(n-1) + 3*floor((n-1)/6), n >= 1. Proof via g.f.. - Wolfdieter Lang, Feb 24 2018
a(n) = (6*n - 13 - 8*cos(2*n*Pi/3) - 3*cos(n*Pi))/12. - Wesley Ivan Hurt, Oct 04 2018

Extensions

Information added to name and comments by Thomas Zaslavsky, Apr 24 2010

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