Showing posts with label approximation. Show all posts
Showing posts with label approximation. Show all posts

Friday, 21 August 2026

Surface Area of a Regular Dodecadhedron


One of the properties of the number associated with my diurnal age today is that it represents the surface area (rounded to the nearest whole number) of a dodecahedron with an edge of 37 units. The formula and result is shown below where \(n\) represents edge length:$$ \begin{align} \text{Surface Area } &= 3 \times n^2 \times \sqrt{{25} + 10 \times \sqrt{5}} \\ &= 3 \times 37^2 \times \sqrt{25 + 10 \times \sqrt{5}} \text{ when }n=37\\ \\&= 28264.0027368755 \dots \\ \\ &\approx 28264 \end{align}$$What's special about the dodecahedron with an edge of 37 units is how close its exact surface area approaches a whole number. The table below shows the results for edges from 1 to 44:

Edge   With Decimal   Rounded

  1      20.645729      21
  2      82.582915      83
  3      185.81156      186
  4      330.33166      330
  5      516.14322      516
  6      743.24624      743
  7      1011.6407      1012
  8      1321.3266      1321
  9      1672.3040      1672
  10     2064.5729      2065
  11     2498.1332      2498
  12     2972.9849      2973
  13     3489.1282      3489
  14     4046.5628      4047
  15     4645.2890      4645
  16     5285.3066      5285
  17     5966.6156      5967
  18     6689.2161      6689
  19     7453.1081      7453
  20     8258.2915      8258
  21     9104.7664      9105
  22     9992.5327      9993
  23     10921.591      10922
  24     11891.940      11892
  25     12903.581      12904
  26     13956.513      13957
  27     15050.736      15051
  28     16186.251      16186
  29     17363.058      17363
  30     18581.156      18581
  31     19840.545      19841
  32     21141.226      21141
  33     22483.199      22483
  34     23866.462      23866
  35     25291.018      25291
  36     26756.865      26757
  37     28264.003      28264
  38     29812.432      29812
  39     31402.154      31402
  40     33033.166      33033
  41     34705.470      34705
  42     36419.066      36419
  43     38173.953      38174
  44     39970.131      39970

Clearly the dodecahedron with edge of 37 units is a clear winner as it has a surface area that differs by only about 0.003 from its surface area when rounded to the nearest whole number.

Thursday, 25 April 2024

Anti-Magic Squares Revisited

I've written about magic squares before. Here are links to these posts:

In this post, I intend to revisit anti-magic squares and the numbers associated with OEIS A117560:


 A117560

\( \text{a}(n) = \dfrac {n \cdot (n^2-1)}{2} - 1 \)



The OEIS comments state that:
\( \text{a}(n-1) \) is an approximation for the lower bound of the "antimagic constant" of an antimagic square of order \(n\). The antimagic constant here is defined as the least integer in the set of consecutive integers to which the rows, columns and diagonals of the square sum. 
The initial members of this sequence are:

2, 11, 29, 59, 104, 167, 251, 359, 494, 659, 857, 1091, 1364, 1679, 2039, 2447, 2906, 3419, 3989, 4619, 5312, 6071, 6899, 7799, 8774, 9827, 10961, 12179, 13484, 14879, 16367, 17951, 19634, 21419, 23309, 25307, 27416, 29639, 31979, 34439, 37022

27416 is highlighted because it is my diurnal age today and when I made my post about anti-magic squares on July 17th 2018, I was 25307 days old. This number immediately precedes 27416, a gap of 2109 (about 5.77 years in terms of days counted). It will be 2223 days, about 6.09 years, before the next number is reached.

The current number, 27416, relates to an approximation of the lowest integer of a 38 x 38 anti-magic square. Note that it is not necessarily the lowest, it's just an approximation. My July 2018 entry is quite thorough and there's no point repeating all the content there but Figure 1 shows an example of 4 x 4 anti-magic square just to reinforce the property of such a square.

Figure 1: source

The ten sums from a sequence of consecutive numbers, namely 
30, 31, 32, 33, 34, 35, 36, 37, 38, 39. Figure 2 shows a different arrangement. Note that OEIS A117560 gives 29 as the lower bound here.

Figure 2: source

Note that an anti-magic square differs from a so-called heterosquare. As explained in Wolfram Mathworld: 
A heterosquare is an \(n \times n\) array of the integers from \(1\) to \(n^2\) such that the rows, columns, and diagonals have different sums. By contrast, in a magic square, they have the same sum. There are no heterosquares of order two, but heterosquares of every odd order exist. They can be constructed by placing consecutive integers in a spiral pattern (Fults 1974, Madachy 1979). An antimagic square is a special case of a heterosquare for which the sums of rows, columns, and main diagonals form a sequence of consecutive integers.

Figure 3 shows an example of a 4 x 4 heterosquare:

Figure 3: source

These numbers do not form a sequence of consecutive integers and so they do not form an anti-magic square.

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

Sunday, 12 February 2023

Kempner Series

I came upon this series quite by accident when investigating what are called Kempner numbers and the Kempner function. Both of these are quite different to the Kempner series defined by Wolfram Mathworld as follows:

A Kempner series \(K_d\) is a series obtained by removing all terms containing a single digit \(d\) from the harmonic series. Surprisingly, while the harmonic series diverges, all 10 Kempner series converge.

The example is given of:$$ K_1= \frac{1}{2}+\frac{1}{3}+\frac{1}{4}+\frac{1}{5}+\frac{1}{6}+\frac{1}{7}+\frac{1}{8}+\frac{1}{9}+\frac{1}{22}+ \dots $$where it can be seen that the fractions 1/1, 1/10, 1/11 etc. have been removed from the harmonic series. In general: $$ \sum_{k=1}^{\infty} \frac{1}{k} \approx 10^n \ln{10}$$when a particular string of length \(n\) is excluded. Thus, when removing the digit 1, the result is about 23.0258509299405. It takes a lot of terms to approach this number. After one million terms, the total is only about 7.717.

Another example is given of removing the string "314" which gives an approximation of 2302.58509299405 (just move the decimal place two to the right) whereas the actual result is closer to 2299.829782. Quite a good approximation. This convergence is surprising given that removing all the composite numbers in the harmonic series still results in its divergence.

So what about Kempner numbers and the Kempner function? The number associated with my diurnal age today, 26978, has a property that qualifies it for inclusion in OEIS A346211:


 A346211

Numbers m such that \( |(K(m+1) - K(m)| = 1\), where \(K(m)\) = A002034(\(m\)) is the Kempner function.



This is where I first came across the word "Kempner". The initial members of the sequence are:

1, 2, 3, 4, 9, 15, 35, 63, 99, 175, 195, 483, 1443, 2057, 2115, 2299, 3363, 3843, 5082, 5475, 6723, 7865, 11235, 11913, 12005, 22747, 24963, 26978, 27555, 31683, 37635, 41514, 46255, 51075, 62464, 68643, 76704, 77283, 89375, 95874, 98595, 104975, 105412, 113398

Following the link to the Kempner function, OEIS A002034, leads to the reference to Kempner numbers:


 A002034

Kempner numbers: smallest positive integer \(m\) such that \(n\) divides \(m\)!.



The initial members of this sequence are:

1, 2, 3, 4, 5, 3, 7, 4, 6, 5, 11, 4, 13, 7, 5, 6, 17, 6, 19, 5, 7, 11, 23, 4, 10, 13, 9, 7, 29, 5, 31, 8, 11, 17, 7, 6, 37, 19, 13, 5, 41, 7, 43, 11, 6, 23, 47, 6, 14, 10, 17, 13, 53, 9, 11, 7, 19, 29, 59, 5, 61, 31, 7, 8, 13, 11, 67, 17, 23, 7, 71, 6, 73, 37, 10, 19, 11, 13, 79, 6, 9, 41, 83, 7

The Kempner function is also known as the Smarandache Function which Wolfram Mathworld describes as:
The Smarandache function \( \mu(n) \) is the function first considered by Lucas (1883), Neuberg (1887), and Kempner (1918) and subsequently rediscovered by Smarandache (1980) that gives the smallest value for a given n at which \(n|\mu(n)!\) (i.e., \(n\) divides \( \mu(n)\) factorial). For example, the number 8 does not divide 1!, 2!, 3!, but does divide 4!=4·3·2·1=8·3, so \( \mu(8)=4\). This function has the property that it has a highly inconsistent growth rate: it grows linearly on the prime numbers but only grows sublogarithmically at the factorial numbers. 
The graph of the function is interesting. See Figure 1.


Figure 1: link

Friday, 23 December 2022

Formula for Pi

I have to remind myself from time to time what a fertile source of information is the website Cantor's Paradise. Today, I came across a tweet from the site's Twitter feed that mentioned a particularly interesting formula for \(\pi\) from Ramanujan. See Figure 1.


Figure 1: link

I'll rewrite the formula below for clarity:$$\frac{1}{\pi}=\frac{2\sqrt{2}}{9801}  \sum_{n=0}^{\infty} \frac{(4n)! (1103+26390n)}{(n!)^4 396^{4n}}$$Now when \(n=0\), we get$$  \frac{1}{ \pi } \approx \frac{1103 \sqrt{8}}{9801} \text{ and } \pi \approx \frac{9801}{1103 \sqrt{8}} $$Now how accurate is this approximation? Permalink

3.1415926535897932385 ... actual digits of pi to 20 decimal places

3.1415927300133056603 approximated digits of pi when \(n=0\) (first term)

This is a pretty impressive approximation for the first term of an infinite series! As the website says:

This gives the accurate value of \(\pi\) up to 6 decimal places, but this is only the 1st term in another infinite series. This number alone is sufficient to calculate the circumference of the Earth with a maximum error of just 1 meter. It is to be noted that while Ramanujan’s formula takes one formula to calculate up to 6 decimal places, it takes Leibniz about 5 million terms. Ramanujan’s formula could do it in one term though and each successive term adds up another 8 decimal places to the value of Ï€. This formula holds absolutely true for finding the value of Ï€, but there is no clear understanding of how he came up with the numbers in his formula like 9801 and 1103. Mathematicians use this formula today to find the value of Ï€ to an insurmountable extent.

Let's set \(n=1\) Permalink:

3.1415926535897932385 actual digits of pi to 20 decimal places

3.1415926535897938780 approximated digits of pi when \(n=1\) (first two terms)

So far we've only displayed \( \pi \) to 20 decimal places but with the addition of another term, there is a need for more accuracy. Here's the result of \(n=2\) Permalink:

3.14159265358979323846264338328 actual digits of pi to 30 decimal places 
3.14159265358979323846264906570 approximated digits of pi when \(n=2\) (first three terms)

There's no need to go further, the improving accuracy is obvious as a result of this amazing formula. Yesterday was Ramanujan's birthday and the twitterverse has been awash with posts about his life and his formulae. He was born on December 22nd 1887 in Tamil Nadu's Erode. 

ADDENDUM: January 16th 2023

Here is another formula for the digits of \( \pi\) that I came across in a tweet:


I won't say anymore about the formula here. I'm just mentioning it and maybe it can form the basis of a future post.

Saturday, 5 November 2022

The Mediant

The mediant is such a simple concept and yet I can't recall ever having heard of the term before.$$ \begin{align} \text{Given two fractions } \frac{a}{b} \text{ and } \frac{c}{d} \text{ such that } \frac{a}{b}<\frac{c}{d} \text{ then}\\ \text{the mediant is defined as } \frac{a+c}{b+d} \text{ where } \frac{a}{b} < \frac{a+c}{b+d} < \frac{c}{d} \end{align} $$There's a nice visual proof of this inequality to be found on this Mathematical Visual Proofs YouTube channel.

One interesting application of the mediant is a means of finding fractional approximations to irrational and transcendental numbers. I got the idea for this after watching this YouTube video titled Fraction-Finding with the Mediant Method and even though the author uses Python it was not clear what he was doing. However, I grasped what he was on about and wrote my own code. Here is a permalink to it in which I've used \(e\) as an example but any number can be used as a target e.g. \( \pi \) or \( \sqrt{2} \). 

The program discards initially the whole number part of the number. So in the case of \(e\), this means discarding 2. What's left is then a decimal number between 0 and 1. We begin by starting with two fractions: one below the number and the other above. If we set \(a=0\) and \(b=1\) and \(c=1\) and \(d=1\) then we know that:$$ \frac{a}{b}=\frac{0}{1}=0 \text{ and } \frac{c}{d}=\frac{1}{1}=1$$are starting points that will always work. The algorithm then generates a new fraction (always 1/2 initially) that may be above or below the (infinite) decimal part of the number that we are trying to approximate. The algorithm ensures that another fraction is always chosen so that it is on the opposite side of the number on the number line. In this way the fractions get closer and closer to the number and the algorithm terminates when the approximation is within a bound that has been set initially.

In the case of \(e\) the following fractions are generated once the integer part has been added back in (so our initial 1/2 becomes 2+1/2 = 5/2 etc):

5/2, 8/3, 11/4, 19/7, 30/11, 49/18, 68/25, 87/32, 106/39, 193/71, 299/110, 492/181, 685/252, 878/323, 1071/394, 1264/465, 1457/536, 2721/1001, 4178/1537, 6899/2538, 9620/3539, 12341/4540, 15062/5541, 17783/6542, 20504/7543, 23225/8544, 25946/9545, 49171/18089, 75117/27634, 124288/45723, 173459/63812, 222630/81901, 271801/99990, 320972/118079, 370143/136168, 419314/154257, 468485/172346, 517656/190435, 566827/208524, 1084483/398959

I set the acceptable error to 0.000000000001 and once the fraction was below this the program stopped. The output that should be displayed above is:

Final approximating fraction for e is 1084483/398959
Decimal approximation is for e is 2.71828182845856
Actual decimal approximation for e is 2.71828182845905