完全直方体問題(2)


関東器材 アルミ製 化粧ブロック 365mm AB-365
半端に条件を満たすように、強引な計算をしてみました。


 x-y面の対角線αは\(\alpha^{2} = x^{2}+y^{2}\)…(1)
x-z面の対角線βは\(\beta^{2} = x^{2}+z^{2}\)…(2)
y-z面の対角線γは\(\gamma^{2} = y^{2}+z^{2}\)…(3)
立方体の中を斜めに突っ切る対角線δは\(\delta^{2} = \gamma^{2}+x^{2} = x^{2}+y^{2}+z^{2}\)…(4)


 (1)~(4)のうち、(2),(3),(4)で整数になる条件を満たすようなものを力技で調べた。
1から1000まで総当たりで調べた結果、

\((x,y,z,\beta,\gamma,\delta)=(153,672,104,185,680,697)\)
\((x,y,z,\beta,\gamma,\delta)=(520,756,117,533,765,925)\)
\((x,y,z,\beta,\gamma,\delta)=(672,153,104,680,185,697)\)
\((x,y,z,\beta,\gamma,\delta)=(756,520,117,765,533,925)\)
たったの4つ。
(1)の条件を満たすのはなかなか絶望的だなぁ。


 力技ソースコードはこんな感じ。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            cal();
        }

        static void cal()
        {
            for (int x = 1; x <= 1000; x++)
            {
                int x2 = x * x;
                for (int y = 1; y <= 1000; y++)
                {
                    int y2 = y * y;
                    for (int z = 1; z <= 1000; z++)
                    {
                        int z2 = z * z;
                        for (int d = 1; d <= 1000; d++)
                        {
                            int ans = x2 + y2 + z2 - d * d;

                            if (ans == 0)
                            {
                                for (int g = 1; g < 1000; g++)
                                {
                                    int ans2 = y2 + z2 - g * g;
                                    if (ans2 == 0)
                                    {
                                        for (int b = 1; b < 1000; b++)
                                        {
                                            int ans3 = x2 + z2 - b * b;
                                            if (ans3 == 0)
                                            {
                                                Debug.WriteLine("(x,y,z,b,g,d)=({0},{1},{2},{3},{4},{5})", x, y, z, b, g,d);
                                            }
                                        }
                                    }
                                }
                            }

                        }
                    }
                }
            }
        }
    }
}