Showing posts with label cube root. Show all posts
Showing posts with label cube root. Show all posts

Sunday, 15 September 2024

Compressing a Hollow Cube


Rewatching the movie "Transformers", my attention was caught by the giant (presumably hollow) cube made up out of many tiny "unit" cubes, that reassembled itself into a much smaller solid cube. This got me thinking about what volume a hollow cube could be compressed into to form a solid cube. Let's consider a  hollow cube with a side of \(n\) units. It has a volume of \(n^3\) cubic units with a hollow centre of \( (n-2)^3 \) cubic units . Thus the number of unit cubes are:$$\begin{align} n^3 - (n-2)^3 &= 2 (n^2 + n(n-2) + (n-2)^2) \\ &= 2(n^2+n^2-2n+n^2-4n+4)\\ &=2(3n^2-6n+4) \end{align}$$Using this formula we can determine the size of the solid cube that can be formed from the unit cubes and how many blocks are left over from this process. See Table 1.


Table 1: permalink

From Table 1 we can see that 216 of the 218 unit cubes that comprise a hollow cube of side 7 units can be used to form a solid cube of side 6 units with only two cubes left over. See Table 2.


Table 2

Also we can see that 13824 of the 13826 unit cubes that comprise a hollow cube of side 49 units can be used to form a solid cube of side 24 units with only two cubes left over. See Table 3.


Table 3

Looking beyond the figures in Table 1, we find that hollow cubes with sides of 163, 385, 751 and 1297 units also compress to solid cubes with sides of 54, 96, 150 and 216 units with two cubes left over (permalink).

We can summarise the results for the "2 left over hollow to solid cubes" as follows:

  • (7, 6) gives 62.97 % ratio of volumes (solid to hollow)
  • (49, 24) gives 11.75 % ratio of volumes (solid to hollow)
  • (163, 54) gives 3.636 % ratio of volumes (solid to hollow)
  • (385, 96) gives 1.550 % ratio of volumes (solid to hollow)
  • (751, 150) gives 0.7968 % ratio of volumes (solid to hollow)
  • (1297, 216) gives 0.4619 % ratio of volumes (solid to hollow)

Naturally as the side length of the hollow cube increases, the ratio of the volume of the solid cube to its hollow counterpart decreases rapidly as more and more empty space is formed inside. For example, in the case of the 751 hollow cube, the ratio of the solid to hollow volumes in less than 1%. It can be noted that none of the sides of the "2 left over hollow to solid cubes" have any factors in common.

Let's see if there's a pattern in the sides of the hollow and solid cubes:
  • 7 = 7 and 6 = 2 * 3
  • 49 = 7^2 and 24 = 2^3 * 3
  • 163 = 163 and 54 = 2 * 3^3
  • 385 = 5 * 7 * 11 and 96 = 2^5 * 3
  • 751 = 751 and 150 = 2 * 3 * 5^2
  • 1297 = 1297 and 216 = 2^3 * 3^3
It can be seen that the solid cubes all contain "6" as a factor. Let's investigate further. Is it possible that a hollow cube with integer sides can be collapsed into a solid cube of integer side \(x\) with no unit cubes left over? If it were possible then we would have:$$ \begin{align} 2(3n^2-6n+4) &= x^3\\6n^2-12n+8 &= x^3\\x &= (6n^2-12n+8)^{1/3}  \end{align}$$Now testing up to \(n=10000\), the expression on the LHS of the equation above never produces a whole number. I'll test for larger values of \(n\) later.

What about when there are two unit cubes left over. In that case we have:$$ \begin{align} 2(3n^2-6n+4) &= x^3+2\\6n^2-12n+6 &= x^3 \\ x &= (6n^2-12n+6)^{1/3} \end{align} $$Now in this case, up to \(n=10000\), we get all the solutions shown above plus some more. These are shown in Table 4.


Table 4: permalink

So the key equation to work with is \(6n^2-12n+(8-a) \) where \(a\) is the number of unit cubes left over. Up to 10000, there are no solutions for \(a=0\) and \(a=1\) but with \(a=2\) we get the solutions shown in Table 4. Going back to Table 1 and using the values of \(a\) shown there in the column "blocks wasted" will produce other tables of solutions as shown in Table 4. There's more to be discovered here but this post is at least a start.

Saturday, 6 July 2024

Hidden Pandigitals

When we think of pandigital numbers, it is a number like 1263480759 that comes to mind. Each of the digits from 0 to 9 occur exactly once. There are 3,265,920 such numbers (leading zeroes not being considered) out of the total of 3,486,784,401 possible ten digit numbers. That's a representation of about 0.094%.

There are however, other ways in which pandigital numbers can arise and one way is in the decimal approximations of the square roots of whole numbers when approximated to ten digits NOT ten decimal places. Some of the digits will occur in the whole number part of the square root and the rest will occur in the decimal part. An example is the square root of 1362 where we have:$$ \sqrt{1362}=36.90528417 \dots$$Note that the final digit arises from truncation of the infinite decimal and not from rounding. Essentially, the decimal point is ignored and so associated with certain whole numbers are their pandigital square roots expressed as whole numbers themselves with the decimal points ignored. The complete list of such numbers, up to 40000, is as follows:$$ \begin{align} 1362 &\rightarrow 3690528417\\1843 &\rightarrow 4293017586\\2540 &\rightarrow 5039841267\\4280 &\rightarrow 6542170893\\5507 &\rightarrow 7420916385\\6896 &\rightarrow 8304215796\\14601 &\rightarrow 1208345976\\15143 &\rightarrow 1230568974\\17547 &\rightarrow 1324650897\\18393 &\rightarrow 1356207948\\20337 &\rightarrow 1426078539\\22710 &\rightarrow 1506983742\\23560 &\rightarrow 1534926708\\25887 &\rightarrow 1608943752\\27487 &\rightarrow 1657920384\\30728 &\rightarrow 1752940386\\32286 &\rightarrow 1796830542\\32615 &\rightarrow 1805962347\\33144 &\rightarrow 1820549367\\34499 &\rightarrow 1857390642\\37194 &\rightarrow 1928574603 \end{align} $$Of course it's easy enough to see where the decimal point should be. These numbers form OEIS A113507 (permalink). We can extend this idea to cube roots and in so doing the first number to make an appearance is 2017 because:$$ (2017)^{1/3}=12.63480759 \dots$$The numbers up to 40000 are (permalink):$$ \begin{align} 2017 &\rightarrow 1263480759\\3053 &\rightarrow 1450693287\\9950 &\rightarrow 2150837964\\15139 &\rightarrow 2473806519\\15533 &\rightarrow 2495083671\\18357 &\rightarrow 2637954108\\24214 &\rightarrow 2893047156\\24424 &\rightarrow 2901386574\\31457 &\rightarrow 3156742089\\32654 &\rightarrow 3196284750\\39605 &\rightarrow 3408657291 \end{align} $$These numbers form OEIS A119517. This approach can be extended to fourth roots and beyond. We can also consider whole numbers raised to let's say \(1/ \pi \). For example:$$3638^{1/ \pi}=  13.59746028 \dots$$jUpt to 40000, the following whole numbers lead to pandigitals when raised to the power \(1/ \pi\):$$ \begin{align} 3638 &\rightarrow 1359746028\\7109 &\rightarrow 1682940375\\10271 &\rightarrow 1892064735\\11572 &\rightarrow 1965273840\\13818 &\rightarrow 2079431586\\14435 &\rightarrow 2108547963\\20539 &\rightarrow 2359047168\\20981 &\rightarrow 2375089614\\26220 &\rightarrow 2549731608\\27158 &\rightarrow 2578419036\\27313 &\rightarrow 2583094176\\35022 &\rightarrow 2795816403\\35330 &\rightarrow 2803619574\\35901 &\rightarrow 2817964035\\37023 &\rightarrow 2845703691 \end{align} $$Not surprisingly this sequence of numbers is not found in the OEIS.

Wednesday, 9 August 2023

Gray Code to the Rescue

Try as I might to find something interesting about the numerical properties of 27155, the number associated with my diurnal age yesterday, I couldn't. I looked through all my usual sources and spent quite time wracking my brain. Eventually I focused on the number's Gray Code. Follow the link for more information.

Because there is a 1-to-1 correspondence between a number and its Gray Code, I thought I'd look at the absolute value of the difference between the two. In the case of 27155, its Gray Code is 24346 and the difference is 2809. Fortunately, this number happens to be a perfect square \(53^2\). How often is this difference a perfect square was the next question that I asked myself.

It turns out that there are 359 such numbers in the range up to 40000. This represents 0.8975% of the range and so such numbers are relatively rare. Here is the list:

1, 2, 3, 6, 8, 9, 18, 24, 25, 32, 33, 47, 51, 54, 72, 73, 79, 96, 97, 128, 129, 159, 162, 211, 214, 216, 217, 227, 230, 271, 288, 289, 306, 338, 384, 385, 419, 422, 512, 513, 575, 578, 648, 649, 703, 706, 751, 787, 790, 856, 857, 864, 865, 883, 886, 920, 921, 1058, 1119, 1152, 1153, 1224, 1225, 1311, 1352, 1353, 1378, 1423, 1458, 1490, 1536, 1537, 1603, 1606, 1688, 1689, 1731, 1734, 1779, 1782, 1827, 1830, 1971, 1974, 2048, 2049, 2175, 2178, 2312, 2313, 2431, 2434, 2592, 2593, 2824, 2825, 3160, 3161, 3171, 3174, 3219, 3222, 3424, 3425, 3456, 3457, 3544, 3545, 3680, 3681, 3763, 3766, 3939, 3942, 3987, 3990, 4083, 4086, 4207, 4232, 4233, 4306, 4418, 4608, 4609, 4896, 4897, 5202, 5408, 5409, 5512, 5513, 5570, 5775, 5810, 5832, 5833, 5960, 5961, 6002, 6034, 6063, 6144, 6145, 6275, 6278, 6424, 6425, 6531, 6534, 6739, 6742, 6752, 6753, 6936, 6937, 7128, 7129, 7283, 7286, 7320, 7321, 7491, 7494, 7843, 7846, 7896, 7897, 7987, 7990, 8192, 8193, 8447, 8450, 8712, 8713, 8959, 8962, 9248, 9249, 9551, 9736, 9737, 10063, 10143, 10368, 10369, 10466, 10655, 10975, 11296, 11297, 11506, 11538, 11567, 11791, 11826, 12095, 12223, 12640, 12641, 12696, 12697, 12739, 12742, 12888, 12889, 13347, 13350, 13651, 13654, 13696, 13697, 13824, 13825, 14176, 14177, 14307, 14310, 14499, 14502, 14720, 14721, 14819, 14822, 15064, 15065, 15768, 15769, 15859, 15862, 15960, 15961, 16344, 16345, 16754, 16928, 16929, 17224, 17225, 17672, 17673, 17810, 17839, 17951, 18018, 18210, 18271, 18432, 18433, 19071, 19327, 19584, 19585, 20079, 20178, 20290, 20418, 20594, 20687, 20808, 20809, 21632, 21633, 22048, 22049, 22280, 22281, 22402, 22671, 22706, 23240, 23241, 23328, 23329, 23567, 23602, 23840, 23841, 24008, 24009, 24136, 24137, 24306, 24338, 24367, 24576, 24577, 24835, 24838, 25112, 25113, 25347, 25350, 25696, 25697, 26136, 26137, 26968, 26969, 27008, 27009, 27155, 27158, 27603, 27606, 27744, 27745, 27955, 27958, 28115, 28118, 28512, 28513, 28755, 28758, 29144, 29145, 29280, 29281, 29976, 29977, 30131, 30134, 31091, 31094, 31384, 31385, 31584, 31585, 31960, 31961, 32307, 32310, 32768, 32769, 33279, 33282, 33800, 33801, 34303, 34306, 34848, 34849, 35407, 35848, 35849, 36431, 36992, 36993, 37346, 37538, 38367, 38559, 38944, 38945, 39410, 39442, 39471

Looking at the numbers in this list, it is apparent that many of them occur in pairs or separated by 3. For example, the next number after 27155 is 27158 which has to do with the changing of the binary digits. I've added this sequence of numbers to my Bespoken for Sequences database as S085:

A variation on this idea is to consider those numbers whose difference with their Gray Code equivalents is a cube. There are 82 such numbers in the range up 40000. I've added this sequence of numbers to my Bespoken for Sequences database as S087:

The list is:

1, 2, 3, 6, 16, 17, 48, 49, 78, 91, 128, 129, 202, 215, 254, 263, 282, 384, 385, 624, 625, 779, 1024, 1025, 1616, 1617, 1775, 2032, 2033, 2256, 2257, 2718, 3072, 3073, 3410, 3706, 4394, 4855, 4992, 4993, 6739, 6742, 7079, 7903, 8192, 8193, 10722, 11747, 11750, 12928, 12929, 13115, 13166, 15850, 16256, 16257, 18048, 18049, 18618, 20091, 21744, 21745, 22503, 23470, 24223, 24576, 24577, 26531, 26534, 27280, 27281, 27554, 29648, 29649, 32307, 32310, 35152, 35153, 39442, 39471, 39936, 39937

The numbers together with their Gray Code equivalents, differences and cube root of differences are shown below:

[(1, 1, 0, 0), (2, 3, 1, 1), (3, 2, 1, 1), (6, 5, 1, 1), (16, 24, 8, 2), (17, 25, 8, 2), (48, 40, 8, 2), (49, 41, 8, 2), (78, 105, 27, 3), (91, 118, 27, 3), (128, 192, 64, 4), (129, 193, 64, 4), (202, 175, 27, 3), (215, 188, 27, 3), (254, 129, 125, 5), (263, 388, 125, 5), (282, 407, 125, 5), (384, 320, 64, 4), (385, 321, 64, 4), (624, 840, 216, 6), (625, 841, 216, 6), (779, 654, 125, 5), (1024, 1536, 512, 8), (1025, 1537, 512, 8), (1616, 1400, 216, 6), (1617, 1401, 216, 6), (1775, 1432, 343, 7), (2032, 1032, 1000, 10), (2033, 1033, 1000, 10), (2256, 3256, 1000, 10), (2257, 3257, 1000, 10), (2718, 4049, 1331, 11), (3072, 2560, 512, 8), (3073, 2561, 512, 8), (3410, 3067, 343, 7), (3706, 2375, 1331, 11), (4394, 6591, 2197, 13), (4855, 7052, 2197, 13), (4992, 6720, 1728, 12), (4993, 6721, 1728, 12), (6739, 6010, 729, 9), (6742, 6013, 729, 9), (7079, 5748, 1331, 11), (7903, 4528, 3375, 15), (8192, 12288, 4096, 16), (8193, 12289, 4096, 16), (10722, 15635, 4913, 17), (11747, 15122, 3375, 15), (11750, 15125, 3375, 15), (12928, 11200, 1728, 12), (12929, 11201, 1728, 12), (13115, 10918, 2197, 13), (13166, 10969, 2197, 13), (15850, 8991, 6859, 19), (16256, 8256, 8000, 20), (16257, 8257, 8000, 20), (18048, 26048, 8000, 20), (18049, 26049, 8000, 20), (18618, 27879, 9261, 21), (20091, 26950, 6859, 19), (21744, 32392, 10648, 22), (21745, 32393, 10648, 22), (22503, 31764, 9261, 21), (23470, 30329, 6859, 19), (24223, 29136, 4913, 17), (24576, 20480, 4096, 16), (24577, 20481, 4096, 16), (26531, 21618, 4913, 17), (26534, 21621, 4913, 17), (27280, 24536, 2744, 14), (27281, 24537, 2744, 14), (27554, 24179, 3375, 15), (29648, 19000, 10648, 22), (29649, 19001, 10648, 22), (32307, 16682, 15625, 25), (32310, 16685, 15625, 25), (35152, 52728, 17576, 26), (35153, 52729, 17576, 26), (39442, 55067, 15625, 25), (39471, 55096, 15625, 25), (39936, 53760, 13824, 24), (39937, 53761, 13824, 24)]

Another idea is to look at all those numbers whose Gray Codes are simply permutations of the number's original digits. It turns out that there are only 48 numbers with this property in the range up to 40000. I've added this sequence of numbers to my Bespoken for Sequences database as S086:


The list is as follows:

1, 54, 1126, 1488, 1489, 1636, 1637, 1746, 1812, 1813, 2351, 3272, 3273, 3492, 3624, 3625, 4356, 4659, 6544, 6545, 6902, 6985, 7051, 7248, 7249, 7520, 7550, 14184, 14185, 15041, 15101, 23500, 23501, 24219, 24907, 25173, 26519, 26635, 27402, 28213, 28292, 28293, 31428, 32157, 34305, 35258, 35380, 35411

Here are the numbers together with the permutated digits:

(1, 1), (54, 45), (1126, 1621), (1488, 1848), (1489, 1849), (1636, 1366), (1637, 1367), (1746, 1467), (1812, 1182), (1813, 1183), (2351, 3512), (3272, 2732), (3273, 2733), (3492, 2934), (3624, 2364), (3625, 2365), (4356, 6534), (4659, 6954), (6544, 5464), (6545, 5465), (6902, 6029), (6985, 5869), (7051, 5710), (7248, 4728), (7249, 4729), (7520, 5072), (7550, 5057), (14184, 11484), (14185, 11485), (15041, 10145), (15101, 10115), (23500, 30250), (23501, 30251), (24219, 29142), (24907, 20974), (25173, 21375), (26519, 21596), (26635, 23566), (27402, 24207), (28213, 22831), (28292, 22982), (28293, 22983), (31428, 18342), (32157, 17235), (34305, 50433), (35258, 52583), (35380, 53038), (35411, 53114)

Tuesday, 4 July 2023

Nested Radicals

I came across a problem in Cliff Pickover's Twitter feed. It is depicted in Figure 1.


Figure 1

No solution was offered so I did a search of Google Images and came up with a link to MathWorld. It is there that a solution is offered:$$ \sqrt{x}=\sqrt[3]{x  \, \sqrt[3]{x  \, \sqrt[3]{x \cdots}}}$$This is an instance of a more general formula:$$ x^{1/(n-1)}=\sqrt[n]{x \, \sqrt[n]{x \, \sqrt[n]{x \, \cdots}}}$$When \(n=3\), we get the original formula that Pickover was referencing. There are other interesting results in the MathWorld article. The following is particularly striking:$$ x^{e-2}=\sqrt{x  \, \sqrt[3]{x \, \sqrt[4] {x \, \sqrt[5]{x  \cdots}}}}$$Presh Talwalkar has a very helpful article on this topic that explains how this last result is obtained. See Figure 2.

Figure 2

A few days later, I came across another nested radical problem in a YouTube video. This is the problem: $$ ?=\sqrt{2+\sqrt{2-\sqrt{2 + \sqrt{2 - \cdots}}}}$$The solution is quite different to the previous approach and begins by replacing the ? with a \(y\) and making use of the fact that the nested radical is infinite:$$ \begin{align} y &= \sqrt{2+\sqrt{2-\sqrt{2 + \sqrt{2 - \cdots}}}} \\ &=\sqrt{2+ \sqrt{2 - y}}\end{align}$$Now we have to impose limits on the range of values that \(y\) can take. A little inspections shows that: $$ \sqrt{2} \leq y \leq 2$$Now we can proceed to find \(y\) by squaring both sides twice and then gathering terms together:$$ \begin{align} y^2 &= 2+\sqrt{2-y} \\ y^2-2 &= \sqrt{2-y} \\ (y^2-2)^2 &= 2-y \\ y^4 -4y^2+4 &= 2-y \\ y^4 - 4y^2 +y +2 &= 0 \\ y^2(y^2-4)+y+2 &=0 \\y^2(y+2)(y-2)+y+2 &= 0 \\(y+2)(y^2(y-2)+1) &= 0 \\ (y+2)(y^3-2y^2+1) &= 0     \end{align}$$Now \(y-1\) divides the cubic expression and so the LHS of the quartic equation becomes: $$ (y+2)(y-1)(y^2-y-1) = 0 $$ There are four solutions \(y_1, y_2, y_3\) and \(y_4\): $$ \begin{align} y_1 &= -2 \\ y_2 &= 1 \\ y_3 &= \frac{1+\sqrt{5}}{2} \\ y_4 &= \frac{1-\sqrt{5}}{2} \end{align} $$Due to restrictions placed on \(y\) however, only \(y_3\) is a valid solution and its value of course is \( \phi \). Thus solution is $$ \phi =\sqrt{2+\sqrt{2-\sqrt{2 + \sqrt{2 - \cdots}}}}$$This is not the only nested radical to produce \( \phi \). An even simpler expression is: $$ \phi=\sqrt{1+\sqrt{1+\sqrt{1+\cdots}}}$$See WOLFRAM Demonstrations Link titled Nested Square Root Representation of the Golden Ratio for more details. Another site at iiTutor shows that:$$ \begin{align} 2 &= \sqrt{2+\sqrt{2+\sqrt{2+\cdots}}}\\1 &= \sqrt{2-\sqrt{2-\sqrt{2-\cdots}}} \end{align}$$

Friday, 3 March 2023

Irrational Number Approximations by Egyptian Fractions

I've written about Egyptian fractions before in a post titled The Greedy Algorithm on the 2nd August 2020. However, this post deals with ways of representing proper fractions, like 5/7, as Egyptian fractions. How do we approximate an irrational number such as \(\pi\) by Egyptian fractions?

The question arose because the number associated with my diurnal age today, 26997, has a property that qualifies for admission in OEIS A132556:


 A132556

Egyptian fraction representation for the cube root of 82.  

In the case of \(82^{1/3}\) one obvious way of achieving this is to first get the initial digits of its digital representation. We find that:$$82^{1/3} \approx 4.3444814857686119017$$This means that the proper fraction to convert into an Egyptian fraction is:$$\frac{3444814857686119017}{10000000000000000000}$$Taking this fraction and using this algorithm, we find that:$$82^{1/3} \approx 4+\frac{1}{3}+ \frac{1}{90}+ \frac{1}{26997} +  \frac{1}{5832713646}+ \dots$$These initial fractions are in agreement with the OEIS output but subsequent ones are not. Of course, while the Egyptian fractions were ideally suited to the purposes for which the Egyptians put them, they were never intended as approximations for irrational numbers of whose existence they were oblivious.

Egyptian fraction representations are not unique and especially so when dealing with approximations of irrational numbers. The Engels expansion is an alternative and thus we have:$$82^{1/3} \approx 4+ \frac{1}{3}+ \frac{1}{90}+ \frac{1}{27000}+ \frac{1}{233280000} + \dots$$The best rational approximations for irrational numbers remain the progressive approximations afforded by the number's continued fraction. In case of the cube root of 82 we have the following progressive approximations:$$\frac{9}{2},\frac{ 13}{3}, \frac{126}{29}, \frac{391}{90}, \frac{ 1299}{299}, \frac{ 121198}{27897}, \frac{ 486091}{111887},\frac{ 2065562}{475445}$$Figure 1 shows an interesting and relevant response to the Quora question: Is there any pattern in the Egyptian fraction representation of Pi?


Figure 1