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.

A176571 Magic constants of 5 X 5 magic squares which consist of consecutive primes.

Original entry on oeis.org

313, 577, 703, 785, 865, 949, 1111, 1703, 2041, 2071, 2579, 2677, 2809, 3157, 3379, 3545, 4001, 4135, 4873, 5143, 5513, 5549, 5659, 5695, 5731, 5917, 6031, 6277, 6427, 6547, 7951, 8027, 8425, 8873, 9569, 9995, 10147, 10393, 10511, 10717, 11321, 11479, 12127
Offset: 1

Views

Author

Natalia Makarova, Apr 20 2010

Keywords

Comments

Let Z be the sum of 25 consecutive primes. The necessary condition to get a magic square of these primes is: z = 5(2m + 1), where m is natural number. The magic constant of expected square is S = 2m + 1.
The first array of consecutive primes, which satisfies this condition, can be obtained for m = 156. This array gives the smallest magic square with magic constant 313.
But not every array of 25 consecutive primes, satisfying the above condition, can be arranged into a magic square. Of the first 50 potential arrays we get 32 magic squares.
The suitable and non-suitable arrays are forming a certain pattern. There is an assumption that the sequence can be continued indefinitely.
Another problem is to find all the magic squares from the certain array. There is an implemented algorithm to solve it, but it takes quite much time.
Let K be the total number of magic squares composed of the numbers of the array for the rotations and reflections.
It was possible to obtain: for S = 949 K = 16140, for S = 1703 K = 5608.
For a fixed magic constant S, it is easy to obtain the set of n^2 consecutive primes that sum up to n*S, and in particular the smallest one: see the PROGRAM in A272386 which computes the smallest prime for any of the magic sums listed here (for n = 5), and A260673 for the n = 4 analog. - M. F. Hasler, Oct 28 2018

Examples

			Three examples of magic squares, which follow the one with the smallest constant.
Array: 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179
z = 2885, S = 577
   59  61 127 179 151
  107 131 167  83  89
  173 149  67  79 109
  101 139 103 163  71
  137  97 113  73 157
Array: 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199
z = 3515, S = 703
   79  83 149 199 193
  107 173 179 131 113
  181 167 151 101 103
  197  89  97 163 157
  139 191 127 109 137
Array: 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227
z = 3925, S = 785
   97 101 149 211 227
  199 179 163 107 137
  109 197 167 173 139
  223 127 113 191 131
  157 181 193 103 151
		

Crossrefs

Cf. A173981 (analog for 4 X 4 squares), A073520, A272386.

Programs

  • PARI
    A176571(n, p=A272386[n], N=5)=sum(i=2, N^2, p=nextprime(p+1), p)/N \\ Uses pre-computed array A272386, but can also be used to find these values: see there. - M. F. Hasler, Oct 30 2018

Extensions

a(33)-a(43) from Arkadiusz Wesolowski, Apr 28 2016