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.

Previous Showing 31-40 of 40 results.

A356643 a(n) is the number of order-n magic triangles composed of the numbers from 1 to n(n+1)/2 in which the sum of the k-th row and the (n-k)-th row is same for all k and all three directions, counted up to rotations and reflections.

Original entry on oeis.org

1, 0, 0, 0, 612, 22411, 0
Offset: 1

Views

Author

Donghwi Park, Aug 19 2022

Keywords

Comments

The magic sum is n*(n*(n + 1)/2 + 1)/2.

Examples

			a(1) is trivially 1.
a(2) is trivially 0.
a(4k-1) for positive integers k is trivially 0 because the magic sums are not integers in these cases.
a(4) is 0.
An example of a solution at n=5:
.
                 1
             15     5
           9     4     7
       12     6     8    13
     3    11     2    10    14
.
An example of a solution at n=6:
.
                 5
             19    16
          12     1    20
        9     6    10     8
    18    11     7    21     2
  3    17    13     4    14    15
.
		

Crossrefs

Cf. A000217 (triangular number), A006052 (magic square), A004767, A342467, A355119.

Formula

a(n) = 0 if n is a multiple of 4 minus 1.

A261815 Total number of semimagic squares of order n that can be formed from the numbers 1, ..., n^2.

Original entry on oeis.org

1, 0, 72, 549504, 4632344409600
Offset: 1

Views

Author

Arkadiusz Wesolowski, Nov 18 2015

Keywords

Crossrefs

Formula

a(n) = A261816(n)*A048617(n) for n > 1.

A323303 Number of ways to arrange the prime indices of n into a matrix with equal column-sums.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 3, 1, 2, 2, 3, 1, 3, 1, 3, 2, 2, 1, 4, 2, 2, 2, 3, 1, 6, 1, 2, 2, 2, 2, 10, 1, 2, 2, 4, 1, 6, 1, 3, 3, 2, 1, 5, 2, 3, 2, 3, 1, 4, 2, 4, 2, 2, 1, 12, 1, 2, 3, 4, 2, 6, 1, 3, 2, 6, 1, 10, 1, 2, 3, 3, 2, 6, 1, 5, 3, 2, 1, 12, 2, 2
Offset: 1

Views

Author

Gus Wiseman, Jan 17 2019

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The a(90) = 16 matrix-arrangements of (3,2,2,1) with equal column-sums:
  [1 2] [2 1] [2 3] [3 2]
  [3 2] [2 3] [2 1] [1 2]
.
  [1] [1] [1] [2] [2] [2] [2] [2] [2] [3] [3] [3]
  [2] [2] [3] [1] [1] [2] [2] [3] [3] [1] [2] [2]
  [2] [3] [2] [2] [3] [1] [3] [1] [2] [2] [1] [2]
  [3] [2] [2] [3] [2] [3] [1] [2] [1] [2] [2] [1]
		

Crossrefs

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    facs[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&,Select[facs[n/d],Min@@#>=d&]],{d,Rest[Divisors[n]]}]];
    ptnmats[n_]:=Union@@Permutations/@Select[Union@@(Tuples[Permutations/@#]&/@Map[primeMS,facs[n],{2}]),SameQ@@Length/@#&];
    Table[Length[Select[ptnmats[n],SameQ@@Total/@Transpose[#]&]],{n,100}]

A323524 Number of integer partitions of n whose parts can be arranged into a square matrix with equal row and column sums.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 2, 1, 3, 2, 3, 1, 5, 1, 4, 4, 6, 1, 10, 1, 7, 10, 6, 1, 24, 2, 7, 22, 18, 1, 38, 1, 35, 43, 9, 6, 124, 1, 10, 77, 158, 1, 110, 1, 285, 186, 12, 1, 742, 2, 170, 203, 1110, 1, 285, 480, 2115, 306, 15, 1
Offset: 0

Views

Author

Gus Wiseman, Jan 17 2019

Keywords

Examples

			The a(12) = 5 integer partitions are (12), (5,5,1,1), (4,4,2,2), (3,3,3,3), (2,2,2,1,1,1,1,1,1). For example, such a matrix for (2,2,2,1,1,1,1,1,1) is:
  [1 1 2]
  [2 1 1]
  [1 2 1]
		

Crossrefs

Formula

a(p) = 1 and a(p^2) = 2 for p prime (see comment in A323349). - Chai Wah Wu, Jan 20 2019

Extensions

a(16)-a(59) from Chai Wah Wu, Jan 20 2019

A375416 Number of order n magic triangles composed of the numbers from 1 to n^2 in which the sum of each 2 X 2 subtriangle is the same, counted up to rotations and reflections.

Original entry on oeis.org

1, 4, 144, 38336, 539904, 87249024
Offset: 1

Views

Author

Donghwi Park, Aug 15 2024

Keywords

Comments

An order n triangle contains binomial(n,2) upright 2 X 2 subtriangles and binomial(n-2,2) inverted 2 X 2 subtriangles. In total, there are n^2-3*n+3 subtriangles.
It seems that the sequence is likely finite. Considering each of the n^2! possibilities of arranging 1..n^2, for each of the (n^2-3n+3) subtriangles only one choice for the central value can give the magic sum. We should, therefore, divide (n^2)! by (n^2)^(n^2-3*n+3) to calculate an estimation of a(n). For n >= 16, (n^2)!/(n^2)^(n^2-3*n+3) < 1.
For n >= 3, a(n) is a multiple of 8, because swapping between a corner triangle and an edge-adjacent triangle generate different examples,
Disregarding corner swap, a(3) to a(6) would be "18, 4792, 67488, 10906128"

Examples

			a(1)=1 because there is only the trivial case without any subtriangle.
a(2)=4 because we can choose only the number in the central triangle.
a(3)=18, which is same for A342467(4)*8. Trotter's order 4 magic triangle can be transformed to this order-3 magic triangle disregarding corner swap.
For n = 3, numbers 1..9 are placed inside the triangles shown:
        o
       / \
      o-- o
     / \ / \
    o---o---o
   / \ / \ / \
  o---o---o---o
An example with magic sum=17:
        9
        5
      1   2
      6   4
   7    3    8
This corresponds to the magic perimeter triangle (A342467):
     1 9 5 2
      7   4
       6 8
        3
		

Crossrefs

A257316 Smallest magic constant of ultramagic squares of order n composed of distinct prime numbers.

Original entry on oeis.org

3505, 990, 4613, 2040
Offset: 5

Views

Author

Natalia Makarova, Apr 20 2015

Keywords

Comments

A magic square is associative if the sum of any two elements symmetric about its center is the same. A magic square is pandiagonal if the sum of the numbers in any broken diagonal equals the magic constant. A magic square is ultramagic if it is associative and pandiagonal.
Ultramagic squares exist for orders n>=5.
The following bounds for the next terms are known: 12249<=a(9)<=13059, 4200<=a(10)<=46150, a(11)>=26521, a(12)>=8820, a(13)>=49439, a(14)>=16170, a(15)>=74595, a(16)>=21840.

Examples

			a(6)=990 corresponds to the following ultramagic square found by _Max Alekseyev_:
  103  59 163 233 139 293
  229 257 307 131  13  53
  283  17  67 173 181 269
   61 149 157 263 313  47
  277 317 199  23  73 101
   37 191  97 167 271 227
a(7)=4613 corresponds to the following ultramagic square found by _Natalia Makarova_:
   227  617  677  431 1217 1307  137
  1259  827 1061  509  521  167  269
   347  929 1187   17  557  719  857
    89  479   29  659 1289  839 1229
   461  599  761 1301  131  389  971
  1049 1151  797  809  257  491   59
  1181   11  101  887  641  701 1091
a(8)=2040 corresponds to the following ultramagic square found by _Natalia Makarova_:
  241 199 409 467  47  79 359 239
  421 137   7  53 487 179 317 439
   31 281 347 353 227 277 127 397
  449 197 109 379 491 337  11  67
  443 499 173  19 131 401 313  61
  113 383 233 283 157 163 229 479
   71 193 331  23 457 503 373  89
  271 151 431 463  43 101 311 269
		

Crossrefs

A266237 Number of magic squares of order n composed of the numbers from 1 to n^2, counted up to rotations, reflections, and M-transformations.

Original entry on oeis.org

1, 0, 1, 220, 68826306, 739745383235859818
Offset: 1

Views

Author

Max Alekseyev, Dec 25 2015

Keywords

Comments

Chebrakov (2008) defines M-transformations of a magic square to be simultaneous permutations of its rows/columns that preserve the content of each diagonal (i.e., M-transformations can only shuffle the diagonal elements). The number of M-transformations of a magic square of order n equals A000165(floor(n/2)) = 2*A002866(floor(n/2)). Half of the M-transformations can be obtained from the other half by rotations by 180 degrees (or by reflections about a diagonal).
Obviously, there is no magic square for n=2, although the MATLAB command magic(n) returns a non-magic square with determinant -10. - Altug Alkan, Dec 25 2015

Crossrefs

Cf. A006052.

Formula

a(n) = A006052(n) / A002866(floor(n/2)).

Extensions

a(6) from Hidetoshi Mino, Jul 22 2023
a(6) corrected by Hidetoshi Mino, May 31 2024

A272262 Number of true systems of magical circles of order n.

Original entry on oeis.org

0, 48, 218592
Offset: 2

Views

Author

Michel Marcus, Apr 24 2016

Keywords

Crossrefs

Cf. A006052.

A364527 Triangle read by rows giving the number of square arrays composed of the numbers from 1 to n^2, counted up to rotation and reflection, with heterogeneity k, i.e., number of k different sums of rows, columns or diagonals with 1 <= k <= 2*n+2 for n > 1.

Original entry on oeis.org

1, 0, 0, 0, 0, 3, 0, 1, 22, 346, 2060, 7989, 17160, 14662, 3120, 880
Offset: 1

Views

Author

Martin Renner, Jul 27 2023

Keywords

Comments

T(n,1) gives the number of magic squares A006052(n).
For n > 1, T(n,2*n+2) gives the number of squares with maximum heterogeneity, i.e., all sums are different (but do not necessarily form a sequence of consecutive integers), sometimes called (super)heterogeneous squares or antimagic squares.
Subsets of T(n,2) or T(n,3) with one or both of the diagonal sums not equal to the magic constant are sometimes called semimagic squares.
Sum_{k=1..2*n+2} T(n,k) = A086829(n) = (n^2)!/8 for n > 1.

Examples

			T(n,k) starts with
  n = 1: 1;
  n = 2: 0, 0, 0, 0, 3, 0;
  n = 3: 1, 22, 346, 2060, 7989, 17160, 14662, 3120;
etc.
For n = 2 there are only three square arrays up to rotation and reflection, all of heterogeneity k = 5, i.e.,
  [1 2] [1 2] [1 3]
  [3 4] [4 3] [4 2]
since there are always the five different sums of rows, columns and diagonals 3, 4, 5, 6 and 7.
For n = 3 the lexicographically first square arrays of heterogeneity 1 <= k <= 8 are
  [2 7 6] [1 2 6] [1 2 5] [1 2 3] [1 2 3] [1 2 3] [1 2 3] [1 2 3]
  [9 5 1] [5 9 4] [3 9 6] [5 6 4] [4 5 6] [4 5 7] [4 5 6] [4 5 8]
  [4 3 8] [3 7 8] [4 7 8] [9 7 8] [7 8 9] [6 9 8] [7 9 8] [6 9 7]
For k = 1 we have the famous Lo Shu square with magic sum (n^3+n)/2 = 15. The other sums for the given examples are (9, 18), (8, 18, 19), (6, 15, 18, 24), (6, 12, 15, 18, 24), (6, 11, 14 16, 18, 23), (6, 12, 14, 15, 16, 17, 24) and (6, 11, 13, 14, 16, 17, 18, 22). Note that there are different sets of sums, namely a total of 6 with two values, 61 with three, 348 with four, 1295 with five, 2880 with six, 3845 with seven and 1538 with eight.
		

References

  • Pierre Berloquin, Garten der Sphinx. 150 mathematische Denkspiele, München 1984, p. 20, nr. 15 (Heterogene Quadrate), p. 20, nr. 16 (Antimagie), p. 86, nr. 148 (Höhere Antimagie), pp. 99-100, 178 (Solutions).

Crossrefs

A368676 Number of 4 X 4 prime magic squares with magic sum 2n.

Original entry on oeis.org

128, 0, 0, 160, 0, 0, 224, 0, 64, 384, 64, 192, 2112, 96, 224, 4768, 0, 480, 5472, 160, 1088, 6688, 160, 1632, 13600, 416, 1728, 24640, 544, 3008, 40736, 512, 6720, 45504, 672, 11776, 41984, 2752, 17888, 65760, 4416, 18688, 128544, 4544, 21888, 162240, 3712
Offset: 60

Views

Author

Zhao Hui Du, Jan 02 2024

Keywords

Examples

			[17, 11, 31, 61]
[43, 67,  3,  7]
[41, 37, 13, 29]
[19,  5, 73, 23]
 is a 4 X 4 prime magic square in which the elements in each row and column and both diagonals sum to 120 and all elements are prime numbers. There are a total of 128 such prime magic squares so a(60)=128.
		

Crossrefs

Previous Showing 31-40 of 40 results.