Последний раз редактировалось dmd 22.08.2013, 07:16, всего редактировалось 2 раз(а).
Квадраты 14х14, 15х15, 20х20, найденные мною по решеткам: (Оффтоп)
14x14 _37310 (1439,2213,3881,499,3833,3517,1523,3079,811,3767,1229,4283,5939,1297), (4657,2111,4241,3943,1427,1433,4483,1789,67,1801,3011,2557,769,5021), (2203,3967,179,4751,4457,1949,3581,2251,3389,929,3023,3559,1823,1249), (4513,7,191,4261,3433,1787,523,5231,4721,2917,4451,1913,823,2539), (5531,967,2531,3989,1013,1291,2503,2137,1571,4951,3407,2417,2099,2903), (587,6037,4931,887,3847,3019,853,757,4637,2467,613,3491,3187,1997), (1871,3121,4799,2617,1049,3371,4049,1619,4673,4027,521,1721,1693,2179), (977,3217,5059,1697,367,3701,3251,2803,797,4007,4327,1993,3877,1237), (3191,4679,2663,1759,1201,2609,1061,3163,5099,787,2441,3571,2999,2087), (3461,773,193,5113,4357,211,4001,3697,1399,2447,4813,1907,431,4507), (4289,829,2741,1741,4391,2287,2141,5147,1181,2411,3343,2647,569,3593), (4423,2927,1153,2657,4877,2713,641,2477,2857,1879,223,3331,4481,2671), (131,2879,1861,3299,2711,3631,3797,1259,1931,1783,4691,457,3533,5347), (37,3583,2887,97,347,5791,4903,1901,4177,3137,1217,3463,5087,683)
15x15 _18063 (149,1381,1049,2141,1627,1151,1171,1123,383,1721,859,2221,839,1031,1217), (2027,1483,1609,337,1019,2153,1289,1489,1789,857,499,367,1511,1531,103), (547,1187,1063,2341,947,2161,601,557,2467,1823,1423,67,709,1907,263), (809,1873,541,1259,787,1871,521,281,2039,1181,3001,1319,2251,79,251), (167,967,1723,2129,1543,397,659,211,1399,1637,2389,1583,1429,911,919), (1777,1949,2383,983,1831,277,43,1163,47,2647,257,1993,571,821,1321), (1553,1901,2309,1291,1453,419,1889,829,409,347,1801,191,941,37,2693), (269,1117,1373,2729,2281,349,307,389,853,1439,2011,1753,1277,223,1693), (2143,233,977,877,131,1153,1747,2213,1237,937,2357,2593,317,1087,61), (1427,757,59,29,1051,1013,1973,1657,2963,1663,353,1409,929,2203,577), (1579,1433,883,587,691,3049,887,1129,1667,1361,1009,139,1607,1759,283), (907,2621,1447,271,1613,2377,2417,157,991,373,107,137,2053,1523,1069), (2083,109,2063,1301,1103,1567,467,2131,227,1109,7,881,1061,2671,1283), (1979,1021,433,239,487,73,2879,2803,313,727,113,2179,197,1597,3023), (647,31,151,1549,1499,53,1213,1931,1279,241,1877,1231,2371,683,3307)
20x20 _64060 (1277,4973,6131,1423,3187,179,4337,3931,1627,3823,331,2711,3067,1693,2713,2617,6857,5347,2503,5333), (3229,1163,229,3329,1249,2399,4259,3259,2707,5623,1033,6091,2657,4153,4283,2689,6173,2677,6211,647), (3011,1301,3331,89,491,1753,1637,2039,2633,3001,1667,4289,4691,4177,6991,4679,5189,5783,2389,4919), (3851,6607,3079,4027,4621,431,101,4447,2671,1453,199,2417,1361,6353,6067,3061,3511,1171,6569,2063), (3697,5179,487,2861,3727,1483,4093,2089,4787,4231,1447,3593,191,5039,8117,3733,3613,83,1871,3739), (4967,5437,3767,907,4409,1009,5113,2099,4513,2521,2767,2789,1087,1019,2609,1327,1039,6029,1759,8893), (3863,4057,1709,5879,6521,3917,5881,2729,1889,2267,2347,4547,2999,1051,4861,1409,743,4723,1217,1451), (2311,6709,5689,4957,1601,947,5857,797,1913,6547,3821,4783,5281,751,631,5167,4909,1061,17,311), (3701,4297,3433,5903,617,4943,5651,3541,5683,1439,2027,3889,4357,4969,1867,2333,1657,367,3037,349), (2371,2377,5147,787,877,4649,109,6961,3299,5843,4493,3709,6719,2293,4597,317,2749,853,1669,4241), (1877,2017,3877,5867,3251,4021,4441,821,1973,5779,1259,3041,5693,3797,599,3929,3221,401,5839,2357), (3343,691,1373,5923,5569,1381,547,1031,4549,6317,5507,2851,2551,1303,5479,2693,3,6323,3109,3517), (6343,1229,3407,3361,2287,3853,811,593,571,433,5023,2659,4127,4201,967,5711,2687,6299,5807,3691), (5051,2699,5323,3119,5059,2137,1153,2459,607,709,4049,2239,2161,6007,2647,6421,3137,4463,2843,1777), (3803,5519,149,1091,2393,281,557,3557,3209,151,7369,3677,2129,4987,3457,5279,4481,5077,4483,2411), (4789,911,5297,587,953,6679,2731,5413,1433,467,661,4657,3631,1321,1289,1787,5209,6637,6037,3571), (997,337,2557,2467,6197,5557,1123,5861,3347,6089,7187,3163,4273,113,2351,1621,1201,3919,2797,2903), (397,4339,1549,7873,4421,5821,5381,1237,4889,1319,3673,1187,3391,2543,1879,5261,2917,1993,3533,457), (3461,3121,6949,3089,3359,6043,3499,6869,6311,4817,3373,461,503,2003,107,719,2381,31,2087,4877), (1721,1097,577,521,3271,6577,6779,4327,5449,1231,5827,1307,3191,6287,2549,3307,2383,823,283,6553) Искавший код для 20х20: (Оффтоп)
Код: pdms20x20()= { n= 5; SX= 16015; R= 7000; so= Set(); w= vector(16);
for(l=1, 16,
while(1, m= matrix(n,n); s= so; p= nextprime(3+random(R)); if(!setsearch(s, p), m[1,1]= p;
s= setunion(s, [m[1,1]]); for(k=2, n,
a=b=vector(k-1); z= 1; q= 0; for(i=1, k-1, a[i]= m[k-1,i]); while(z&&(q<1000), p= nextprime(3+random(R)); q++; if(!setsearch(s, p), z= 0; t= s; b[1]= p; for(i=2, k-1, b[i]= b[i-1]+a[i]-a[i-1]; if((b[i]<3)||(!isprime(b[i]))||(setsearch(t, b[i])), z= 1; break(), t= setunion(t, [b[i]])) ) ) ); if(!z, for(i=1, k-1, m[k,i]= b[i]; s= setunion(s, [b[i]])), break());
a=b=vector(k); z= 1; q= 0; for(i=1, k, a[i]= m[i,k-1]); while(z&&(q<1000), p= nextprime(3+random(R)); q++; if(!setsearch(s, p), z= 0; t= s; b[1]= p; for(i=2, k, b[i]= b[i-1]+a[i]-a[i-1]; if((b[i]<3)||(!isprime(b[i]))||(setsearch(t, b[i])), z= 1; break(), t= setunion(t, [b[i]])) ) ) ); if(!z, for(i=1, k, m[i,k]= b[i]; s= setunion(s, [b[i]])), break())
);
if(!z, S= sum(i=1, n, m[i,i]); if(S==SX, print(l); print(" ",S); print(m); v= matrix(n,n); for(i=1,n, for(j=1,n, x= 3*i+2*j; x= x%n; if(x<1, x= x+n); y= i+j; y= y%n; if(y<1, y= y+n); v[x,y]= m[i,j]; so= setunion(so, [m[i,j]]) ) ); w[l]= v; write("pdms.txt",v); break() ) )
) ) );
v= matrix(4*n,4*n); for(i=1, n, for(j=1, n, a= w[1]; v[4*i-3, 4*j-3]= a[i,j]; a= w[2]; v[4*i-3, 4*j-2]= a[i,j]; a= w[3]; v[4*i-3, 4*j-1]= a[i,j]; a= w[4]; v[4*i-3, 4*j-0]= a[i,j]; a= w[5]; v[4*i-2, 4*j-3]= a[i,j]; a= w[6]; v[4*i-2, 4*j-2]= a[i,j]; a= w[7]; v[4*i-2, 4*j-1]= a[i,j]; a= w[8]; v[4*i-2, 4*j-0]= a[i,j]; a= w[9]; v[4*i-1, 4*j-3]= a[i,j]; a= w[10]; v[4*i-1, 4*j-2]= a[i,j]; a= w[11]; v[4*i-1, 4*j-1]= a[i,j]; a= w[12]; v[4*i-1, 4*j-0]= a[i,j]; a= w[13]; v[4*i-0, 4*j-3]= a[i,j]; a= w[14]; v[4*i-0, 4*j-2]= a[i,j]; a= w[15]; v[4*i-0, 4*j-1]= a[i,j]; a= w[16]; v[4*i-0, 4*j-0]= a[i,j]; ) );
for(i=1, 4*n, write1("pdms.txt", "("); for(j=1, 4*n-1, write1("pdms.txt", v[i,j], ",") ); write("pdms.txt", v[i,4*n], "),") )
};
|