One of the properties of the number associated with my diurnal age today () is that it can be expressed as a sum of two squares as well as a sum of two cubes:This immediately caused me to wonder how frequent numbers of this sort are. I asked Gemini to write me a Python program that would output a list of non-negative, non-zero numbers in the range up to 40000 with this dual property. I'm getting lazy I know. Previously, I would have created the SageMath code myself but ... well, this is the future I guess. Here is a link to the code.
As it turns out, such numbers are not that frequent. Here is the list:
65, 370, 468, 520, 637, 730, 793, 1125, 1241, 1332, 1853, 2205, 2745, 2960, 3744, 3925, 4097, 4160, 4706, 4825, 4941, 5096, 5256, 5840, 5913, 6344, 6641, 6984, 7202, 8125, 9000, 9325, 9386, 9477, 9773, 9928, 10656, 11458, 12005, 12168, 12913, 13357, 13498, 13949, 14824, 15626, 15633, 15689, 16021, 16354, 17261, 17640, 18369, 18737, 19721, 19773, 21953, 21960, 22681, 23680, 24901, 26117, 27792, 29449, 29818, 29952, 31213, 31400, 31850, 32389, 32776, 33280, 33650, 34704, 35037, 36650, 37577, 37648, 37681, 38600, 39429, 39528
I was surprised not to find this sequence in the OEIS. I asked Gemini to also give a breakdown of the numbers in terms of their squares and cubes. Figure 1 shows the result.
 |
Figure 1 |
Some of these numbers may be expressible as sums of two squares and sums of two cubes in more than one way but at least one of the possible ways is shown in the two rightmost columns. For 27792 however, the story does end there because it turns out that this number is member of OEIS
A273498: numbers that are the sum of two positive squares, a positive square and a positive cube, and two positive cubes. So for 27792, we have:We can see that:Thus in general if the base is a square number raised to the third power then the swap to a base that is cubic number raised to a square power is always possible. Additionally, if we have a 1 then it can be written as or .
I asked Gemini again to write a Python program that would generate a list of such numbers up to 40000. There were some minor hiccups with this code when entered into SageMathCell as Gemini comments upon:
My apologies for the persistent error. It seems SageMathCell might be interpreting the f-string syntax slightly differently or having an issue with the way the curly braces are nested, particularly around the conditional expression. Let's try a slightly different approach to formatting the output string, using the .format() method instead of f-strings. This might be more compatible with SageMathCell.
In the end the code timed out on SageMathCell and so I used the SageMath app on my MacBook Air to implement the code. The execution took quite some time to complete but in the end it succeeded. Here is the output
(link to code):
65, 468, 730, 793, 1241, 1332, 2745, 4097, 4160, 4825, 5096, 5840, 5913, 6344, 8125, 9000, 9325, 9928, 12168, 13357, 13498, 14824, 15626, 15633, 15689, 16354, 17640, 18369, 18737, 19721, 19773, 21953, 22681, 27792, 29449, 29952, 32776, 34704, 36650, 37577
Figure 2 shows the breakdown of the individual numbers.
 |
Figure 2 |
Clearly these numbers are a subset of the numbers in the previous list. The display of the code in Gemini is quite colourful and helpful as can be seen in Figure 3 that shows a snippet of the code:
 |
Figure 3 |
No comments:
Post a Comment