Saturday, 11 March 2023

Elements, Letters and Numbers

There are 14 elements represented by a single letter on the periodic table: Hydrogen (H), Boron (B), Carbon (C), Nitrogen (N), Oxygen (O), Fluorine (F), Potassium (K), Yttirium (Y), Iodine (I), Tungsten (W), Uranium (U), Sulfur (S), Phosphorus (P), and Vanadium (V). There atomic numbers representing the number of protons in their nuclei are as follows:
  • Hydrogen (H) - 1
  • Boron (B) - 5
  • Carbon (C) - 6
  • Nitrogen (N) - 7
  • Oxygen (O) - 8
  • Fluorine (F) - 9
  • Potassium (K) - 19
  • Yttrium (Y) - 39
  • Iodine (I) - 53
  • Tungsten (W) - 74
  • Uranium (U) - 92
  • Sulfur (S) - 16
  • Phosphorus (P) - 15
  • Vanadium (V) - 23
An interesting question is how many English words can be formed from this mixture of vowels and consonants. Let's repeat the letters below and sort them into two categories:

I, O, U, B, C, F, H, K, N, P, S, V, W, Y

Here are some words that ChatGPT found that can be formed using these letters. It's not an exhaustive list.
hub, cub, sin, pin, win, his, if, vow, soy, spy, wok, sky, sun, pun, fun, kin, ink, no, on, up, us, so, is, by, icy, coy, buy, boy, fob, hob, sob, bow, cow, how, low, now, own, won, you, ivy, ups, cup, pus, sup, pin, nip, hip, sip, cop, sop, vow, sow, soy, cosy, coif, sync, piny, fowl, foul, busy, busybody, snow, snowy, cow, cowpox, cup, cupful, cusp, sushi

Each of these words can be assigned a numeric value on the basis of the atomic numbers associated with their letters. For example, hub = 1 +  92 + 5 = 98 and sushi = 19 + 92 + 19 + 1 + 53 = 184. What I've created is a gematria of sorts.

Of course, one does not need to limit oneself just to elements with a single letter. An article has been written titled List of Words Made From Periodic Table Element Symbols. It was posted on June 17, 2014 by Anne Helmenstine  and updated on January 9, 2023. Figure 1 shows a screenshot displaying the words PHYSiCs, BaNaNa, FUN and GeNiUS.


Figure 1: 

Using the atomic numbers again. It can be seen that PHYSiCs = 124, BaNaNa = 88 and GeNiUS = 168. The words in the article are listed alphabetically and in camel case. Figure 2 shows a screenshot of the C words.

Figure 2

The article only considers the words that can be made from the chemical elements and does not assign the words any numerical values, based on atomic numbers or anything else. That was my idea which is why I'm posting to this mathematics blog and not my Pedogogical Posturing blog. 

I can't think of any practical use for this gematria at the moment but that's of no consequence. Perhaps something will occur to me later. Like in standard Greek or Hebrew gematria, the atomic number assignments to elements will create links between words that add to the same sum. Figure 3 shows a table of elements and atomic numbers, sorted by element.


Figure 3: source

Figure 4 shows a periodic style table that shows the elements sorted by atomic number.


Figure 4: source

Of course there are many words that cannot be formed by combining the letters together e.g. light. We can start with Li (Lithium) but after that no further progress can be made. An interesting SageMath project would be to create a dictionary of elements and their atomic numbers and use this to automatically output the number of any word that was input.

ChatGPT created a list of triplets containing chemical name, chemical symbol and atomic number. Here it is:

[("Hydrogen", "H", 1), ("Helium", "He", 2), ("Lithium", "Li", 3), ("Beryllium", "Be", 4), ("Boron", "B", 5), ("Carbon", "C", 6), ("Nitrogen", "N", 7), ("Oxygen", "O", 8), ("Fluorine", "F", 9), ("Neon", "Ne", 10), ("Sodium", "Na", 11), ("Magnesium", "Mg", 12), ("Aluminum", "Al", 13), ("Silicon", "Si", 14), ("Phosphorus", "P", 15), ("Sulfur", "S", 16), ("Chlorine", "Cl", 17), ("Argon", "Ar", 18), ("Potassium", "K", 19), ("Calcium", "Ca", 20), ("Scandium", "Sc", 21), ("Titanium", "Ti", 22), ("Vanadium", "V", 23), ("Chromium", "Cr", 24), ("Manganese", "Mn", 25), ("Iron", "Fe", 26), ("Cobalt", "Co", 27), ("Nickel", "Ni", 28), ("Copper", "Cu", 29), ("Zinc", "Zn", 30), ("Gallium", "Ga", 31), ("Germanium", "Ge", 32), ("Arsenic", "As", 33), ("Selenium", "Se", 34), ("Bromine", "Br", 35), ("Krypton", "Kr", 36), ("Rubidium", "Rb", 37), ("Strontium", "Sr", 38), ("Yttrium", "Y", 39), ("Zirconium", "Zr", 40), ("Niobium", "Nb", 41), ("Molybdenum", "Mo", 42), ("Technetium", "Tc", 43), ("Ruthenium", "Ru", 44), ("Rhodium", "Rh", 45), ("Palladium", "Pd", 46), ("Silver", "Ag", 47), ("Cadmium", "Cd", 48), ("Indium", "In", 49), ("Tin", "Sn", 50), ("Antimony", "Sb", 51), ("Tellurium", "Te", 52), ("Iodine", "I", 53), ("Xenon", "Xe", 54), ("Cesium", "Cs", 55), ("Barium", "Ba", 56), ("Lanthanum", "La", 57), ("Cerium", "Ce", 58), ("Praseodymium", "Pr", 59), ("Neodymium", "Nd", 60), ("Promethium", "Pm", 61), ("Samarium", "Sm", 62), ("Europium", "Eu", 63), ("Gadolinium", "Gd", 64), ("Terbium", "Tb", 65), ("Dysprosium", "Dy", 66), ("Holmium", "Ho", 67), ("Erbium", "Er", 68), ("Thulium", "Tm", 69), ("Ytterbium", "Yb", 70), ("Lutetium", "Lu", 71), ("Hafnium", "Hf", 72), ("Tantalum", "Ta", 73), ("Tungsten", "W", 74), ("Rhenium", "Re", 75), ("Osmium", "Os", 76), ("Iridium", "Ir", 77), ("Platinum", "Pt", 78), ("Gold", "Au", 79), ("Mercury", "Hg", 80), ("Thallium", "Tl", 81), ("Lead", "Pb", 82), ("Bismuth", "Bi", 83), ("Polonium", "Po", 84), ("Astatine", "At", 85), ("Radon", "Rn", 86), ("Francium", "Fr", 87), ("Radium", "Ra", 88), ("Actinium", "Ac", 89), ("Thorium", "Th", 90), ("Protactinium", "Pa", 91), ("Uranium", "U", 92), ("Neptunium", "Np", 93), ("Plutonium", "Pu", 94), ("Americium", "Am", 95), ("Curium", "Cm", 96), ("Berkelium", "Bk", 97), ("Californium", "Cf", 98), ("Einsteinium", "Es", 99), ("Fermium", "Fm", 100), ("Mendelevium", "Md", 101), ("Nobelium", "No", 102), ("Lawrencium", "Lr", 103), ("Rutherfordium", "Rf", 104), ("Dubnium", "Db", 105), ("Seaborgium", "Sg", 106), ("Bohrium", "Bh", 107), ("Hassium", "Hs", 108), ("Meitnerium", "Mt", 109), ("Darmstadtium", "Ds", 110), ("Roentgenium", "Rg", 111), ("Copernicium", "Cn", 112), ("Nihonium", "Nh", 113), ("Flerovium", "Fl", 114), ("Moscovium", "Mc", 115), ("Livermorium", "Lv", 116), ("Tennessine", "Ts", 117), ("Oganesson", "Og", 118)]

This is suitable for pasting into SageMath and doing further analysis. Here is a permalink to an algorithm that will input chemical symbols that make a word (in camelcase) and output the word in uppercase together with its atomic number value. I've used "B", "O", "Th" and "Er" as input and gotten "BOTHER has an atomic number of 171" as output.

Friday, 10 March 2023

Statistics on Chess Games

My diurnal age today, 27004, turns up in an online table of statistics for chess games. Figure 1 shows the table.


Figure 1: source

A ply is a half-move in chess so what the table is saying is that after five plies there are 27004 different ways in which a king can be placed in check. Figure 2 shows such a situation for white checking the black king.


Figure 2: generated by ChessX

The white queen can move to F7 via F3 or H5. Note that we are not interested in the quality of the chess moves here but merely how a check (but not checkmate) can be achieved on the fifth ply. Figure 3 shows a situation where white achieves checkmate (using a variation of fool's mate) on the fifth ply. Looking at the table in Figure 1, it can be seen that mate by White can be achieved in 347 different ways.


Figure 3: generated by ChessX

Since White moves first, the fifth ply must always be made by White. Likewise, mate on the fourth ply can only be achieved by black and in eight ways, each a variation of fool's mate. Figure 4 shows one such configuration.


Figure 4: generated by ChessX

The number 27004 is a member of OEIS A089956:


 A089956

Number of chess games that end in check (but not checkmate) after exactly \(n\) plies.



The initial members of the sequence are:
  • 0 ways after 0 plies
  • 0 ways after 1 ply
  • 0 ways after 2 plies
  • 12 ways after 3 plies
  • 461 ways after 4 plies
  • 27004 ways after 5 plies
  • 798271 ways after 6 plies
The website displaying these statistics also alerted me to some rules of Chess that I wasn't aware of, namely the automatic draws by 5-fold repetition and the 75-move rule. 
I am ignoring the draw by 3-fold repetition because it is a pain to take into account. Actually, a draw by 3-fold repetition isn't automatic: one of the players must make a correct claim for the draw to occur. So if it's legal to ignore the repetition of position, then I believe that it's ok to enumerate those games. Draw by 5-fold repetition (a rule introduced in 2014) is automatic and should affect the number of games. Initially, the rule was not very clear, with one interpretation suggesting that the earliest it can apply is at ply 22. In 2017, the rule was modified, and it is now clear that the earliest draw by 5-fold repetition occurs at ply 16, reducing the number of games at ply 17 by 16^4*20 = 1310720. Draw by the 50-move rule (not automatic), draw by the 75-move rule (automatic), and draw by impossibility of checkmate (automatic) don't apply before even more moves. For the complete rules of chess (including past versions since 2009), look for Laws of Chess in the FIDE Handbook, section E.01.

Monday, 6 March 2023

27000

A milestone reached. My diurnal age today is 27000 which is the cube of the primorial 30 = 2 x 3 x 5, a sphenic number and thus representable as the sphenic brick shown in Figure 1.


Figure 1


This brick with its volume of 30 cubic units is symbolic of a month of 30 days. If these bricks are positioned to form a base of 15 blocks x 2 by 10 blocks x 3 and then stacked 6 high, a cube of side 30 units is formed. These 900 blocks can be seen as symbolic of 900 months of life.


Of course there being 12 months in a year, these 900 months are equivalent to 75 years and I'm yet to reach my 74th birthday. This is because 12 x 30 = 360 and there are on average 365.425 days in a year. There is an excess of 5.425 which, over the course of 73.92 years, amounts to 401 days. Thus the discrepancy which, in keeping with the notion of bricks, could be envisaged as the mortar between the bricks.

Suffice to say that these bricks would form an impressive structure, although they are not in the same proportions as the standard brick shown in Figure 2. The mortar between bricks normally has a width of 10 mm.


Figure 2

I asked ChatGPT the following question:
I'm looking for interesting things to say about the number 27000. The things of interest could be mathematical but not necessarily so. Anything of interest whether it be historical, scientific, numerological or whatever is acceptable.
This was its response:
Sure, here are some interesting things to say about the number 27000:
  • 27000 is a perfect cube number. It can be written as 30³, which means that it is the product of three 30s multiplied together.

  • In geometry, 27000 is the number of degrees in a 150-sided polygon (also called a hecatoicosagon).

  • The number 27000 has a total of 27 factors, including 1 and itself. This means that it has a lot of divisors, which makes it a useful number in many mathematical contexts.

  • In Hinduism, there is a sacred text called the Mahabharata, which is said to have around 27,000 verses.

  • In astronomy, 27000 is roughly the number of light years that the Solar System travels around the center of the Milky Way galaxy in one orbit.

  • The number 27000 is often used as a benchmark in statistical analysis, particularly in studies involving large datasets. This is because it represents a sufficiently large sample size to generate meaningful results.

  • In the sport of sumo wrestling, 27,000 is the minimum number of spectators that must be in attendance for a tournament to be considered a "sell-out."

  • The year 27000 AD is often cited as a possible time frame for the next Ice Age, based on current climate models.

  • The binary representation of 27000 is 110100100101000, which consists of 15 digits. In binary code, this number can be used to represent various commands or functions.

  • According to numerology, the number 27000 represents balance, harmony, and spiritual enlightenment. It is said to be a powerful number for meditation and personal growth.
Referring to the above points, 27000 does not have 27 factors. It has three distinct prime factors, nine prime factors with multiplicity and 64 divisors. Similarly the binary representation of 27000 is wrong. Correct is 110100101111000, although the stated number of binary digits is correct. One needs to remember to take anything ChatGPT says with a grain of salt when it comes to mathematics. 

I thought I'd pick ChatGPT's brain further and asked:
What examples are there from literature concerning the number 27000?
  • There are several examples in literature that mention the number 27000. Here are a few:

  • In the Hindu epic Mahabharata, there is a reference to an army of 27,000 soldiers that was sent by the Kauravas to capture the Pandavas.

  • In Dante Alighieri's "Divine Comedy," the number 27 is significant as it represents the nine levels of heaven, each with three spheres, making a total of 27.

  • In the book "The Bible Code," written by Michael Drosnin, the number 27000 is said to appear in a code in the Book of Exodus that predicts a future nuclear war.

  • In J.R.R. Tolkien's "The Lord of the Rings," the number 27000 is mentioned in the context of the army of Rohirrim, which consists of 18,000 riders and 9,000 infantry.

  • In the book "The Magic Mountain" by Thomas Mann, the number 27000 is used to describe the number of days that the main character, Hans Castorp, spends in a tuberculosis sanatorium.

  • In the book "The Teachings of Don Juan" by Carlos Castaneda, the number 27000 is used to describe the number of days that the author spent learning from a Yaqui Indian shaman.

  • Overall, the number 27000 appears to have different symbolic meanings in different works of literature, ranging from military might to spiritual significance to the passage of time.
Some of these statistics seem unlikely. The main character in Thomas Mann's book would have spent almost 74 years in the sanatorium and likewise for the Yaqui Indian apprenticeship. I'm not going to check which facts are correct and which are not.

I last celebrated a cubic number day when I turned 24389 (29 cubed) days old on Monday, the 11th January 2016. I'll next celebrate (if I'm around) on Saturday, 26th October 26th 2030 when I turn 29791 (31 cubed) days old.

Sunday, 5 March 2023

The Horn Torus


The Horn Torus is a solid that if formed by the revolution of a circle around a point on its circumference. Suppose the starting circle has a diameter of 1 unit and thus a circumference of \(\pi\) units. Consider a small rotation of length \( \delta x\) along the outer circumference that produces a wedge-shaped solid that is equivalent to a cylinder of curved surface area \(\pi  \delta x/2\). The total surface area of the resultant torus is given by:$$\begin{align} \text{Surface Area }&=\lim_{\delta x \rightarrow 0} \sum_0^{2\pi} \pi \, \delta x/2 \\ &=\int_0^{2\pi} \! \! \pi/2 \, dx\\&=\bigg [ \pi \, x/2 \bigg ]_0^{ 2\pi}\\&=\pi^2 \end{align}$$This is beautifully simple. If we envisage \(\pi\) as the area of a circle with unit radius then \( \pi^2 \) can be envisaged as the surface area of a horn torus with unit tube diameter. 

While we're here, we may as well calculate the volume of a horn torus with a unit tube diameter. The calculation of volume is very similar to that of the surface area. Consider a small rotation of length \( \delta x\) along the outer circumference that produces a wedge-shaped solid that is equivalent to a cylinder of cross-sectional area \( \pi/4\) and thickness \( \delta x/2\). The volume of this wedge shape is \(\pi \, \delta x/8\). The total volume of the resultant torus is given by:$$\begin{align} \text{Volume }&=\lim_{\delta x \rightarrow 0} \sum_0^{2\pi} \pi \, \delta x/8 \\ &=\int_0^{2\pi} \!  \! \pi/8 \, dx\\&=\bigg [ \pi \, x /8 \bigg ]_0^{ 2\pi}\\&=\pi^2/4\end{align}$$

The End of a Millennium

My diurnal age today is 26999 and thus the last of a millennium that began almost three years ago when I turned 26000 days old. The digits of the number have the rather special property that they add to 1:$$\frac{1}{2}+\frac{1}{6}+\frac{1}{9}+\frac{1}{9}+\frac{1}{9}=1$$This property qualifies it for membership in OEIS A091783:


 A091783

Numbers with digits in non-decreasing order such that sum of the reciprocals of the digits is 1.



Such numbers are, not surprisingly, few and far between and all exclude zero. The initial members are:

1, 22, 236, 244, 333, 2488, 2666, 3366, 3446, 4444, 26999, 28888, 33999, 34688, 36666, 44488, 44666, 55555, 366999, 368888, 446999, 448888, 466688, 666666, 3999999, 4688999, 4888888, 6666999, 6668888, 7777777, 66999999, 68888999, 88888888, 999999999 

Here is a permalink to a SageMath algorithm that will generate these numbers up to 40000. If we relax the condition that the digits must be in non-decreasing order but still exclude zero, then up to 40000, the qualifying numbers are:

1, 22, 236, 244, 263, 326, 333, 362, 424, 442, 623, 632, 2488, 2666, 2848, 2884, 3366, 3446, 3464, 3636, 3644, 3663, 4288, 4346, 4364, 4436, 4444, 4463, 4634, 4643, 4828, 4882, 6266, 6336, 6344, 6363, 6434, 6443, 6626, 6633, 6662, 8248, 8284, 8428, 8482, 8824, 8842, 26999, 28888, 29699, 29969, 29996, 33999, 34688, 34868, 34886, 36488, 36666, 36848, 36884, 38468, 38486, 38648, 38684, 38846, 38864, 39399, 39939, 39993

These numbers constitute OEIS  A037268:


 A037268

Sum of reciprocals of digits = 1.   
                                        


If we relax the condition that none of the digits of the number can be zero and simply ignore the zeros when finding the reciprocal sum, then the resultant numbers constitute OEIS  A214959:


 A214959

Numbers for which the sum of reciprocals of nonzero digits = 1.   
     
           

The initial members of the sequence are:

1, 10, 22, 100, 202, 220, 236, 244, 263, 326, 333, 362, 424, 442, 623, 632, 1000, 2002, 2020, 2036, 2044, 2063, 2200, 2306, 2360, 2404, 2440, 2488, 2603, 2630, 2666, 2848, 2884, 3026, 3033, 3062, 3206, 3260, 3303, 3330, 3366, 3446, 3464, 3602, 3620, 3636, 3644, 3663, 4024, 4042, 4204, 4240, 4288, 4346, 4364, 4402, 4420, 4436, 4444, 4463, 4634, 4643, 4828, 4882, 6023, 6032, 6203, 6230, 6266, 6302, 6320, 6336, 6344, 6363, 6434, 6443, 6626, 6633, 6662, 8248, 8284, 8428, 8482, 8824, 8842, 10000, 20002, 20020, 20036, 20044, 20063, 20200, 20306, 20360, 20404, 20440, 20488, 20603, 20630, 20666, 20848, 20884, 22000, 23006, 23060, 23600, 24004, 24040, 24088, 24400, 24808, 24880, 26003, 26030, 26066, 26300, 26606, 26660, 26999, 28048, 28084, 28408, 28480, 28804, 28840, 28888, 29699, 29969, 29996, 30026, 30033, 30062, 30206, 30260, 30303, 30330, 30366, 30446, 30464, 30602, 30620, 30636, 30644, 30663, 32006, 32060, 32600, 33003, 33030, 33066, 33300, 33606, 33660, 33999, 34046, 34064, 34406, 34460, 34604, 34640, 34688, 34868, 34886, 36002, 36020, 36036, 36044, 36063, 36200, 36306, 36360, 36404, 36440, 36488, 36603, 36630, 36666, 36848, 36884, 38468, 38486, 38648, 38684, 38846, 38864, 39399, 39939, 39993

We can generalise even more by relaxing the requirement that the sum of the reciprocals must be unity and instead require it to be simply be any integer. These numbers, with zero excluded, constitute OEIS A034708: 


 A034708

Numbers for which the sum of reciprocals of digits is an integer.   
                


Clearly, the more 1's that there are in the number, the larger the integer e.g. 11111 has a sum of reciprocals of digits equal to 5. The members of this sequence, of which there are 321 members up to 40000, are:

1, 11, 22, 111, 122, 212, 221, 236, 244, 263, 326, 333, 362, 424, 442, 623, 632, 1111, 1122, 1212, 1221, 1236, 1244, 1263, 1326, 1333, 1362, 1424, 1442, 1623, 1632, 2112, 2121, 2136, 2144, 2163, 2211, 2222, 2316, 2361, 2414, 2441, 2488, 2613, 2631, 2666, 2848, 2884, 3126, 3133, 3162, 3216, 3261, 3313, 3331, 3366, 3446, 3464, 3612, 3621, 3636, 3644, 3663, 4124, 4142, 4214, 4241, 4288, 4346, 4364, 4412, 4421, 4436, 4444, 4463, 4634, 4643, 4828, 4882, 6123, 6132, 6213, 6231, 6266, 6312, 6321, 6336, 6344, 6363, 6434, 6443, 6626, 6633, 6662, 8248, 8284, 8428, 8482, 8824, 8842, 11111, 11122, 11212, 11221, 11236, 11244, 11263, 11326, 11333, 11362, 11424, 11442, 11623, 11632, 12112, 12121, 12136, 12144, 12163, 12211, 12222, 12316, 12361, 12414, 12441, 12488, 12613, 12631, 12666, 12848, 12884, 13126, 13133, 13162, 13216, 13261, 13313, 13331, 13366, 13446, 13464, 13612, 13621, 13636, 13644, 13663, 14124, 14142, 14214, 14241, 14288, 14346, 14364, 14412, 14421, 14436, 14444, 14463, 14634, 14643, 14828, 14882, 16123, 16132, 16213, 16231, 16266, 16312, 16321, 16336, 16344, 16363, 16434, 16443, 16626, 16633, 16662, 18248, 18284, 18428, 18482, 18824, 18842, 21112, 21121, 21136, 21144, 21163, 21211, 21222, 21316, 21361, 21414, 21441, 21488, 21613, 21631, 21666, 21848, 21884, 22111, 22122, 22212, 22221, 22236, 22244, 22263, 22326, 22333, 22362, 22424, 22442, 22623, 22632, 23116, 23161, 23226, 23233, 23262, 23323, 23332, 23611, 23622, 24114, 24141, 24188, 24224, 24242, 24411, 24422, 24818, 24881, 26113, 26131, 26166, 26223, 26232, 26311, 26322, 26616, 26661, 26999, 28148, 28184, 28418, 28481, 28814, 28841, 28888, 29699, 29969, 29996, 31126, 31133, 31162, 31216, 31261, 31313, 31331, 31366, 31446, 31464, 31612, 31621, 31636, 31644, 31663, 32116, 32161, 32226, 32233, 32262, 32323, 32332, 32611, 32622, 33113, 33131, 33166, 33223, 33232, 33311, 33322, 33616, 33661, 33999, 34146, 34164, 34416, 34461, 34614, 34641, 34688, 34868, 34886, 36112, 36121, 36136, 36144, 36163, 36211, 36222, 36316, 36361, 36414, 36441, 36488, 36613, 36631, 36666, 36848, 36884, 38468, 38486, 38648, 38684, 38846, 38864, 39399, 39939, 39993

For example, \(36613 \rightarrow \dfrac{1}{3}+\dfrac{1}{6}+\dfrac{1}{6}+\dfrac{1}{1}+\dfrac{1}{3}=2\)

While the sum of reciprocals equaling unity is 26999's most distinctive property and qualifies it for membership in several OEIS sequences, it also enjoys the following interesting properties:

26999 is a Cunningham number since it can be written as \(30^3-1\). 

A number \(n\) is a Cunningham number if it can be written as \(C^{+}(b,k)=b^k+1\)  or  \(C^{-}(b,k)=b^k-1\)  for  \(b,k > 1\). The previous such number was \(26897=164^2+1\) and the next will be \(27001=30^3+1\).

26999 is a de Polignac number because none of the positive numbers \(26999 -2^k\) is a prime. These numbers (all composite) are:

1 --> 26997
2 --> 26995
3 --> 26991
4 --> 26983
5 --> 26967
6 --> 26935
7 --> 26871
8 --> 26743
9 --> 26487
10 --> 25975
11 --> 24951
12 --> 22903
13 --> 18807
14 --> 10615

26999 is a modest number because \(999|26999=26\). See my recent post titled Modest Numbers.

26999 is a Smith number  since the sum of its digits (35) coincides with the sum of the digits of its prime factors.

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

Thursday, 2 March 2023

Hamiltonian Paths Revisited

On the 6th February 2021, I posted about Hamiltonian Paths and Knight's Tours. That was over two years ago now but today I have the opportunity to revisit the topic of Hamiltonian paths because the number associated with my diurnal age, 26996, is a member of OEIS A003778:


 A003778

Number of Hamiltonian paths in \(P_5 \times P_n \).               



In the case of 26996, \(n=6\).  Figure 1 shows such a \(5 \times 6 \) grid.


Figure 1

A Hamiltonian path is one that passes through every vertex exactly once. One example of such a path is shown in Figure 2. Note that in this 2D grid connections between vertices or nodes are made up-down and left-right but not diagonally.


Figure 2

In the case of a \(5 \times 6\) grid, there are 26996 such paths that can be drawn. The number of paths increases rapidly as the number of points increases. Here are the initial values:
  • \(5 \times 1 \rightarrow 1\)
  • \(5 \times 2 \rightarrow 22\)
  • \(5 \times 3 \rightarrow 132\)
  • \(5 \times 4 \rightarrow 1006\)
  • \(5 \times 5 \rightarrow  4324\)
  • \(5 \times 6 \rightarrow 26996\)
  • \(5 \times 7 \rightarrow  109722\)
  • \(5 \times 8 \rightarrow 602804\)
  • \(5 \times 9 \rightarrow 2434670\) 
  • \(5 \times 10 \rightarrow 12287118\)
Here is a permalink to some Python code that will plot a Hamiltonian path through a grid of specified size. Figure 3 shows the output in the case of a \(5 \times 6\) grid:

[(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (0, 5), (1, 5), (1, 4), (1, 3), (1, 2), (1, 1), (1, 0), (2, 0), (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (3, 5), (3, 4), (3, 3), (3, 2), (3, 1), (3, 0), (4, 0), (4, 1), (4, 2), (4, 3), (4, 4), (4, 5)]


Figure 3

This YouTube video does a good job of explaining in simple terms the difference between a Hamiltonian path and an Euler path. For the latter, the path must traverse every edge exactly once whereas in the former it is every vertex that must be traversed.

There is a 36-term linear recurrence mentioned in the OEIS A003778 comments which is the closest thing to a formula that seems to be available for calculating the number of possible paths. Hamiltonian paths and cycles are intimately connected with the travelling salesman problem as this site explains:
Travelling Salesman Problem (TSP): 

Given a set of cities and the distance between every pair of cities, the problem is to find the shortest possible route that visits every city exactly once and returns to the starting point. Note the difference between Hamiltonian Cycle and TSP. The Hamiltonian cycle problem is to find if there exists a tour that visits every city exactly once. Here we know that Hamiltonian Tour exists (because the graph is complete) and in fact, many such tours exist, the problem is to find a minimum weight Hamiltonian Cycle. 

Figure 4

For example, consider the graph shown in the Figure 4 on the right side. A TSP tour in the graph is 1-2-4-3-1. The cost of the tour is 10+25+30+15 which is 80. The problem is a famous NP-hard problem. There is no polynomial-time know solution for this problem. 

The site goes to provide programming solutions to this particular instance of the TSP but the Python3 solution doesn't work. However, the minimum cost Hamiltonian tour is  80 and 1-2-4-3-1 is one solution. This YouTube video offers a useful tutorial on how to draw graphs, such as the one shown in Figure 3, using SageMath.

I discovered an interesting site called Graph Online that allows you to create graphs and find Hamiltonian and Eulerian paths and cycles as well as Adjacency and Incidence Matrices. Figure 5 shows the Hamiltonian path that it came up with for the graph that I drew. No Hamiltonian cycle is possible.

Figure 5

Figure 6 shows a Eulerian path. No Eulerian cycle is possible. The site will display and analyse many other types of graphs. I've just focused on two here.


Figure 6