mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2019-05-05, 04:56   #12
a1call
 
a1call's Avatar
 
"Rashid Naimi"
Oct 2015
Remote to Here/There

2,333 Posts
Default

Looks like it's gonna be a quiet weekend.
So I will post here.

176 correct submissions and no solutions posted yet.

I assume the challenge is closed.

No clue what the May challenge is talking about. Looks like they have decided to raise the bar this month.
a1call is offline   Reply With Quote
Old 2019-05-06, 11:55   #13
Xyzzy
 
Xyzzy's Avatar
 
Aug 2002

23·1,069 Posts
Default

http://www.research.ibm.com/haifa/po...April2019.html
Xyzzy is offline   Reply With Quote
Old 2019-05-08, 00:57   #14
a1call
 
a1call's Avatar
 
"Rashid Naimi"
Oct 2015
Remote to Here/There

233310 Posts
Default

Quote:
Originally Posted by a1call View Post
... because I found it interesting to write a code to generate a code to solve the large matrix.
FWIW & FTR:

You can run the following code in Pari-GP and then Copy & Paste the output (between the Markings) in Pari-GP to solve any (arbitrary speaking) positive odd number of Rows=Columns except for 19, 1 (and incidentally 0 ).

For larger Matrices you would need to modify the code so that it outputs to a file rather than the screen.

The algorithm is to populate all the Matrix with a prime number (19 in this case) and then increment all cells except for the central one by 6*(number of rows) until a prime is found that restores the prime average criteria. It doesn't take long to get a solution.

Code:
\\CTI-100-A by Rashid Naimi
\\ Run once in Pari-GP and the Copy the result between the markings and Paste in Pari-GP
\\ https://pari.math.u-bordeaux.fr/

allocatemem()
theSize = 101 \\\\\Enter an odd number other than 19 (dimension for the number of Rows/Columns)
theSize = theSize\2*2+1
{
theString =Str("
\\\\\\\\\\\\\\\\\\\\\\\\\\\Start copying from here.\\\\\\\\\\\\\\\\\\\\\\\\\\\
theSize = ",theSize ,"
a=matrix(theSize ,theSize )
for(i=1,theSize ,{
  for(j=1,theSize ,
    a[i,j]=19;
  );
})
a
largestPrime =19;
for(i=1,theSize ,{
  for(j=1,theSize ,
    if(i==theSize\\2+1  && j==theSize\\2+1 ,next());
    a[i,j]=largestPrime +theSize *6;
    while(
      !isprime(a[i,j]) || !isprime((a[i,1]");\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
for(k=2,theSize ,theString =Str(theString,"+a[i,",k,"]"));
theString =Str(theString,")/theSize )
      ||
      !isprime((a[1,j]");\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
for(k=2,theSize ,theString =Str(theString,"+a[",k,",j]"));
theString =Str(theString,")/theSize )
      ||
      !isprime((a[1,1]");\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
for(k=2,theSize ,theString =Str(theString,"+a[",k,",",k,"]"));
theString =Str(theString,")/theSize )
      ||
      !isprime((a[1,",theSize ,"]");\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
for(k=2,theSize ,theString =Str(theString,"+a[",k,",",theSize-k+1,"]"));
theString =Str(theString,")/theSize )
      ,a[i,j]=a[i,j]+theSize *6;
    );
    largestPrime =a[i,j];
  );
})
for(i=1,theSize ,print(a[i,]))
\\\\\\\\\\\\\\\\\\\\\\\\\\\End copying here & Paste in Pari-GP\\\\\\\\\\\\\\\\\\\\\\\\\\\

");
}
print(theString );
a 9 x 9 solution:

Code:
[   127    397    829    991   1747   3259   3529   4339   5419]

[  5527   7417   7741   8929  11251  13411  14437  15787  16651]

[ 16759  22051  25939  29017  29989  32257  34039  35227  39979]

[ 42409  44029  47809  59149  60337  61687  62929  64171  65413]

[ 65629  65899  70867  73459     19  74377  76213  78427  79399]

[ 82531  83773  84691 108991 109639 114661 116443 121789 125353]

[129457 130699 148573 149059 149113 153271 158293 158563 162829]

[163909 172009 172171 174763 176383 177949 179947 189019 190261]

[212239 214129 216829 217369 227251 229249 229897 231409 247609]
a 101 x 101 Solution is attached.
Attached Files
File Type: txt 101.txt (112.4 KB, 197 views)
a1call is offline   Reply With Quote
Old 2019-05-08, 03:47   #15
Kebbaj
 
Kebbaj's Avatar
 
"Kebbaj Reda"
May 2018
Casablanca, Morocco

11000112 Posts
Lightbulb

Hi Rachid Naimi,
The question is like this:
Find a b c d e f g h i Such the squre :
a b c
d e f
g h i

(a+b+c)/3 is prime
(d+e+f)/3 prime
(g+h+i)/3 prime

(a+d+g)/3 prime
(b+e+h)/3 prime
(c+f+i)/3 prime

(a+e+i)/3 prime
(c+e+g)/3 prime

All a,b,c,d,e,f,g,h,i are primes numbers.

It's easy 3x3.

Your 9×9 is Fauls:
Example: First line
127+397+829+991+1747+3259+3529+4339+5419= 17378
The average is
17378/9 is not integer. Not Prime.

Reda Kebbaj.
Kebbaj is offline   Reply With Quote
Old 2019-05-08, 04:19   #16
Kebbaj
 
Kebbaj's Avatar
 
"Kebbaj Reda"
May 2018
Casablanca, Morocco

32×11 Posts
Post

There is a lot of 4X4, 5X5 solution.
Here is one from Professor Barry O'Sulivan,MRIA:

4x4

19 37 31 29
97 17 11 23
43 7 13 109
5 103 61 3

Rows: 29.0 37.0 43.0 43.0
Cols: 41.0 41.0 29.0 41.0
Up: 13.0
Down: 2.0

5x5
29 61 41 31 23
127 17 43 19 89
59 67 3 37 199
83 13 79 11 229
7 107 139 47 5

Rows: 37.0 59.0 73.0 83.0 61.0
Cols: 61.0 53.0 61.0 29.0 109.0
Up: 13.0
Down: 2.0

Thanks to Serge Batalov who made me discover by a post on this forum the first time the sit IBM Ponther This.

Reda Kebbaj.
Kebbaj is offline   Reply With Quote
Old 2019-05-08, 04:48   #17
axn
 
axn's Avatar
 
Jun 2003

124748 Posts
Default

Quote:
Originally Posted by Kebbaj View Post
Your 9×9 is Fauls:
Example: First line
127+397+829+991+1747+3259+3529+4339+5419= 17378
The average is
17378/9 is not integer. Not Prime.
Check again. 127+397+829+991+1747+3259+3529+4339+5419 = 20637. The average is 2293 which is a prime.
axn is offline   Reply With Quote
Old 2019-05-08, 23:55   #18
Kebbaj
 
Kebbaj's Avatar
 
"Kebbaj Reda"
May 2018
Casablanca, Morocco

32×11 Posts
Default

Well seen axn!!
Kebbaj is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
January 2019 Xyzzy Puzzles 74 2019-04-09 13:34
March 2019 Xyzzy Puzzles 6 2019-04-04 16:32
February 2019 Xyzzy Puzzles 17 2019-03-07 21:05
2019 Coding Challenge miroslavkures Number Theory Discussion Group 2 2018-12-27 08:59

All times are UTC. The time now is 09:05.


Sun Jan 29 09:05:16 UTC 2023 up 164 days, 6:33, 0 users, load averages: 1.15, 1.00, 1.14

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔