mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2018-01-24, 08:32   #1
firejuggler
 
firejuggler's Avatar
 
Apr 2010
Over the rainbow

2×1,283 Posts
Default The Square-Diff problem

To entertain myself, I decide to tackle a few example of ssquare diff . any square is valid except if b-a=1
min solution seem to be 13.
there is a solution for 14, but not for 15-19... ( or maybe i was too tired to find it).

I found a solution for upto 43 ( it was done manually so no the most efficient manner).
with graphviz I obtained the image below .
I doubt there is any gap further up

Code:
graph gray {     graph[center=true, margin=0.2, nodesep=0.1, ranksep=0.3]
     node[fontname="Courier-Bold", fontsize=9, width=0.4, height=0.4, fixedsize=false]
     
     //*1--17--13--4--8--12--3--7--16--20--11--2--6--15--19--10--14--18--9--5                 long 20 
     //*21--17--1--5--9--18--14--10--19--15--6--2--11--20--16--7--3--12--8--4--13--22                long 22
     //*21--17--1--5--9--18--22--13--4--8--12--3--7--16--20--11--2--6--15--19--10--14--23            long 23
     //*24--8--4--13--22--18--9--5--1--17--21--12--3--7--16--20--11--2--6--15--19--10--14--23            long 24
     //*25--9--18--22--13--4--8--24--15--19--23--14--10--6--2--11--20--16--7--3--12--21--17--1--5            long 25
     //*5--1--26--17--21--12--28--3--7--16--20--11--27--2--6--10--14--23--19--15--24--8--4--13--22--18--9--25
     //*29--25--9--18--22--13--4--8--24--15--19--23--14--10--1--5--30--26--17--21-12--28--3--7--32--16--20--11--27--2--6--31    long 32
     node [shape = doublecircle]; 38 43;
     node [shape = circle];
     38--29 [label="start",color=red]    
     29--25--34--9--18--22--13--4--8--33--24--40--15--19--23--14--10--1--5--30--26--42--17--21--37--12--28--3--7--32--41--16--20--36--11--27--2--6--31--35--39[color=red];
     39--43[color=red,label="end"];
      9--5[color=gray];    
     11 -- 7 [color=gray];    
     13 -- 9[color=gray] ;
     15 -- 11[color=gray];
     16 -- 12[color=gray];
     17--13[color=gray];    
     24--20[color=gray];
     25--21[color=gray];
     26--22[color=gray];
     27--23[color=gray];
     28--24[color=gray];    
     31--27[color=gray];
     32--28[color=gray];
     33--29[color=gray];
     34--30[color=gray];
     36--32[color=gray];
     37--33[color=gray];
     38--34[color=gray];    
     40--36[color=gray];
     42--38[color=gray];
     44--40;
      14 -- 5[color=gray];
     17 -- 8[color=gray];        
     25--16[color=gray];
     27--18[color=gray];
     28--19[color=gray];
     29--20[color=gray];
     30--21[color=gray];
     31--22[color=gray];
     32--23[color=gray];
     35--26[color=gray];
     36--27[color=gray];
     37--28[color=gray];    
     39--30[color=gray];    
     40--31[color=gray];
     42--33[color=gray];
     43--34[color=gray];
     44--35;
      17--1[color=gray];
     18 -- 2[color=gray];        
     19 -- 3[color=gray];
     20 -- 4[color=gray];
     21 -- 5[color=gray];
     22 -- 6[color=gray];
     23 -- 7[color=gray];
     26--10[color=gray];
     29--13[color=gray];
     30--14[color=gray];
     31--15[color=gray];
     33--17[color=gray];
     34--18[color=gray];    
     35--19[color=gray];
     38--22[color=gray];
     39--23[color=gray];
     43--27[color=gray];
     44--28;
     
     35--10[color=gray];
     38--13[color=gray];
     39--14[color=gray];
     43--18[color=gray];
     44--19;
      overlap=false;
     splines=true;
  }
The starting node is 38,end is 43... and I didn't manage to put arrow instead of simple lines
Attached Thumbnails
Click image for larger version

Name:	graph1.png
Views:	187
Size:	156.9 KB
ID:	17594  

Last fiddled with by firejuggler on 2018-01-24 at 08:33
firejuggler is offline   Reply With Quote
Old 2018-01-24, 23:27   #2
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by firejuggler View Post
To entertain myself, I decide to tackle a few example of ssquare diff . any square is valid except if b-a=1
min solution seem to be 13.
there is a solution for 14, but not for 15-19... ( or maybe i was too tired to find it).

I found a solution for upto 43 ( it was done manually so no the most efficient manner).
with graphviz I obtained the image below .
I doubt there is any gap further up

Code:
graph gray {     graph[center=true, margin=0.2, nodesep=0.1, ranksep=0.3]
     node[fontname="Courier-Bold", fontsize=9, width=0.4, height=0.4, fixedsize=false]
     
     //*1--17--13--4--8--12--3--7--16--20--11--2--6--15--19--10--14--18--9--5                 long 20 
     //*21--17--1--5--9--18--14--10--19--15--6--2--11--20--16--7--3--12--8--4--13--22                long 22
     //*21--17--1--5--9--18--22--13--4--8--12--3--7--16--20--11--2--6--15--19--10--14--23            long 23
     //*24--8--4--13--22--18--9--5--1--17--21--12--3--7--16--20--11--2--6--15--19--10--14--23            long 24
     //*25--9--18--22--13--4--8--24--15--19--23--14--10--6--2--11--20--16--7--3--12--21--17--1--5            long 25
     //*5--1--26--17--21--12--28--3--7--16--20--11--27--2--6--10--14--23--19--15--24--8--4--13--22--18--9--25
     //*29--25--9--18--22--13--4--8--24--15--19--23--14--10--1--5--30--26--17--21-12--28--3--7--32--16--20--11--27--2--6--31    long 32
     node [shape = doublecircle]; 38 43;
     node [shape = circle];
     38--29 [label="start",color=red]    
     29--25--34--9--18--22--13--4--8--33--24--40--15--19--23--14--10--1--5--30--26--42--17--21--37--12--28--3--7--32--41--16--20--36--11--27--2--6--31--35--39[color=red];
     39--43[color=red,label="end"];
      9--5[color=gray];    
     11 -- 7 [color=gray];    
     13 -- 9[color=gray] ;
     15 -- 11[color=gray];
     16 -- 12[color=gray];
     17--13[color=gray];    
     24--20[color=gray];
     25--21[color=gray];
     26--22[color=gray];
     27--23[color=gray];
     28--24[color=gray];    
     31--27[color=gray];
     32--28[color=gray];
     33--29[color=gray];
     34--30[color=gray];
     36--32[color=gray];
     37--33[color=gray];
     38--34[color=gray];    
     40--36[color=gray];
     42--38[color=gray];
     44--40;
      14 -- 5[color=gray];
     17 -- 8[color=gray];        
     25--16[color=gray];
     27--18[color=gray];
     28--19[color=gray];
     29--20[color=gray];
     30--21[color=gray];
     31--22[color=gray];
     32--23[color=gray];
     35--26[color=gray];
     36--27[color=gray];
     37--28[color=gray];    
     39--30[color=gray];    
     40--31[color=gray];
     42--33[color=gray];
     43--34[color=gray];
     44--35;
      17--1[color=gray];
     18 -- 2[color=gray];        
     19 -- 3[color=gray];
     20 -- 4[color=gray];
     21 -- 5[color=gray];
     22 -- 6[color=gray];
     23 -- 7[color=gray];
     26--10[color=gray];
     29--13[color=gray];
     30--14[color=gray];
     31--15[color=gray];
     33--17[color=gray];
     34--18[color=gray];    
     35--19[color=gray];
     38--22[color=gray];
     39--23[color=gray];
     43--27[color=gray];
     44--28;
     
     35--10[color=gray];
     38--13[color=gray];
     39--14[color=gray];
     43--18[color=gray];
     44--19;
      overlap=false;
     splines=true;
  }
The starting node is 38,end is 43... and I didn't manage to put arrow instead of simple lines
Has the same logic constraints I listed in the sum problem. Maybe you can use a setup similar to the one used there.

Last fiddled with by science_man_88 on 2018-01-24 at 23:28
science_man_88 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Square-Sum problem henryzz Puzzles 28 2018-03-17 09:05
Lines in a Square Kees Puzzles 16 2009-05-07 15:24
red square Fusion_power Puzzles 14 2008-04-25 11:37
Fast way to square??? maheshexp Math 2 2004-05-29 01:54
possibly simple question regarding P4 vs AthlonXP speed diff penguin22 Software 23 2002-10-08 21:34

All times are UTC. The time now is 03:43.

Wed May 19 03:43:52 UTC 2021 up 40 days, 22:24, 0 users, load averages: 1.91, 2.37, 2.37

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, 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.