Two Irrational Numbers That Give the Last Non-Zero Digits of $n!$ and $n^n$
Gregory Dresden

TL;DR
This paper constructs irrational numbers from sequences of last non-zero digits of factorials and powers, revealing new properties of these digit patterns and their relation to irrationality.
Contribution
It introduces a novel approach to generating irrational numbers using last non-zero digits of factorials and powers, connecting digit patterns to irrationality.
Findings
The constructed numbers are proven to be irrational.
Patterns in last non-zero digits influence the irrationality.
New connections between digit sequences and number theory are established.
Abstract
If we form a decimal where the nth digit is the last non-zero digit of (likewise, the last non-zero digit of ), we obtain an irrational number
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsHistory and Theory of Mathematics · Mathematics and Applications · Advanced Mathematical Theories
Two Irrational Numbers That Give the Last Non-Zero Digits of and .
Gregory P. Dresden
Washington & Lee University
Lexington, VA 24450
Author’s Note: This is a slightly revised version of the article that appeared in print in Mathematics Magazine in October of 2001. The original proof of Theorem 2 was incorrect; I’ve fixed that mistake here. My thanks to Antonio M. Oller-Marcén and José Mara Grau for pointing out to me the error.
Also, Stan Wagon pointed out in a letter to Mathematics Magazine (February 2002) that the question of the periodicity of the last non-zero digit of (our Theorem 1) appeared several times in Crux Mathematicorum in the 1990’s: see v. 18 n. 7 (Sep 1992) page 196 for the statement of the problem, v. 19 n. 8 (Oct 1993) page 228 for an incorrect solution, v. 19 n. 9 (Nov 1993) page 260 for Stan Wagon’s correct solution, and v. 20 n. 2 (Feb 1994) page 44 for another reference.
I wrote a sequel to this paper, called “Three Transcendental Numbers From the Last Non-Zero Digits of , , and ”. It appeared in Mathematics Magazine, April 2008.
We begin by looking at the pattern formed from the last (i.e. unit) digit of . Since , , , , and so on, we can easily calculate the first few numbers in our pattern to be . We construct a decimal number such that the digit of is the last (i.e. unit) digit of ; that is, . In a recent paper [1], R. Euler and J. Sadek showed that this is a rational number with a period of twenty digits:
[TABLE]
This is a nice result, and we might well wonder if it can be extended. Indeed, Euler and Sadek in [1] recommend looking at the last non-zero digit of (If we just looked at the last digit of , we would get a very dull pattern of all [math]’s, as ends in [math] for every .)
With this is mind, let’s define to be the last nonzero digit of the positive integer ; it is easy to see that , where is the largest power of that divides . We wish to investigate not only the pattern formed by , but also the pattern formed by . In accordance with [1], we define the “factorial” number to be the infinite decimal such that each digit , and we define the “power” number to be the infinite decimal such that each digit , and we ask whether these numbers are rational (i.e. are eventually-repeating decimals) or irrational.
Although the title of this article gives away the secret, we’d like to point out that at first glance, our “factorial” number exhibits a suprisingly high degree of regularity, and a fascinating pattern occurs. The first few digits of are easy to calculate:
[TABLE]
[TABLE]
[TABLE]
…
Reading the underlined digits, we have:
[TABLE]
Continuing along this path, we have (to forty-nine decimal places):
[TABLE]
It is not hard to show that (after the first four digits) breaks up into five-digit blocks of the form , where , and the and are taken mod . Furthermore, if we represent these five-digit blocks by symbols ( for , for , for , for , and for the initial four-digit block of ), we have:
[TABLE]
Grouping these symbols into blocks of five and then performing more calculations (with the aid of Maple) give us to decimal places:
[TABLE]
The reader will notice additional patterns in these blocks of five symbols (twenty-five digits). In fact, such patterns exist for any block of size . However, a pattern is different from a period, and doesn’t imply that our decimal is rational. Consider the classic example of , which has an obvious pattern but is obviously irrational. It turns out that our decimal is also irrational, as the following theorem indicates:
Theorem 1. *Let be the infinite decimal such that each digit . Then, is irrational. *
As for our “power” number , it too might seem to be rational at first glance. P is only slightly different from Euler and Sadek’s rational number N, as seen here:
[TABLE]
(Again, calculations were performed by Maple.) Despite this striking similarity between and , it turns out that , like , is irrational:
Theorem 2. *Let be the infinite decimal such that each digit . Then, is irrational. *
Before we begin with the (slightly technical) proofs, let us pause and see if we can get a feel for why these two numbers must be irrational. There is no doubt that both and are highly “regular”, in that both exhibit a lot of repetition. The problem is that there are too many patterns in the digits, acting on different scales. Taking , for example, we note that there is an obvious pattern (as shown by Euler and Sadek in [1]) repeating every digits with , , and , but this is broken by a similar pattern for and , which repeats every digits. This, in turn, is broken by another pattern repeating every , and so on. A similar behaviour is found for , but in blocks of , , , and so on, as mentioned above. So, in vague terms, there are always “new patterns” starting up in the digits of and of , and this is what makes them irrational.
Are there some simple observations that we can make about and which might help us to prove our theorems? To start with, we might notice that every digit of (except for the first one) is even. Can we prove this? Yes, and without much difficulty:
Lemma 1. *For , then is in . *
Proof: The lemma is certainly true for . For , we note that the prime factorization of contains more ’s than ’s, and thus even after taking out all the ’s in , the quotient will still be even. To be precise, the number of ’s in (and thus the number of trailing zeros in its base- representation) is , which is strictly less than the number of ’s, (here, represents the greatest integer function). Hence, is an even integer not divisible by , and so , which must be in . This completes the proof.
Another helpful observation is to note that the lnzd function appears to be multiplicative. For example,
[TABLE]
However, we note that at times this “rule” fails:
[TABLE]
So, we can only prove a limited form of multiplicativity, but it is useful none the less:
Lemma 2. *Suppose are integers such that , . Then, lnzd is multiplicative; that is, mod . *
Proof: Let denote the integer without its trailing zeros; that is, , where is the largest power of dividing . (Note that mod .) By hypothesis, and are both mod , and so mod and so . Thus,
[TABLE]
This completes the proof.
We are now ready to supply the proof of Theorem 1, in which we show that is irrational. The proof is a little technical, but it relies first on assuming that has a repeating decimal expansion, then on choosing an appropriate multiple of the period and choosing an appropriate digit , in order to arrive at a contradiction.
Proof of Theorem 1: We argue by contradiction. Suppose is rational. Then is eventually periodic; let be the period (i.e. for every sufficiently large, then ). Write such that (we acknowledge that could be ) and let . Then, , and since , then and so mod . Note also that mod . Choose sufficiently large so that both of the following are true: (this can easily be done by demanding that ), and for all , then , which of course would then equal . Finally, let . By Lemma 1, , and since , then also equals .
Since is a multiple of the period , then if we let and , then:
[TABLE]
Let’s now look at the last two terms in the above equation; it is here we will find our contradiction. Note that since , then . Also, since mod , we know that . Thus, we can apply Lemma 2 to to get:
[TABLE]
Likewise, working with , we find:
[TABLE]
Combining these two equations, we get:
[TABLE]
and this becomes mod . Since is even, this implies that mod and mod , which is a contradiction. Thus, there can be no period and so is irrational. This completes the proof.
We now turn our attention to the “power” number P derived from the last non-zero digits of . This part was more difficult, but a major step was the discovery that the sequence , , was the same as the sequence , , . This relies not only on the fact that but also on the fact that for , as used in the following lemma:
Lemma 3. *Suppose . Then, mod . *
Proof: As in Lemma 2, let denote the integer without its trailing zeros; that is, , where is the largest power of dividing . Now,
[TABLE]
Since , then , and so:
[TABLE]
Since , then , and since mod for every positive , we have:
[TABLE]
This completes the proof.
With Lemma 3 at our disposal, the proof of Theorem 2 is now fairly easy.
Proof of Theorem 2: Again, we argue by contradiction. Suppose is rational. Let be the period, and choose sufficiently large such that and such that for every positive . Choosing , we get:
[TABLE]
We reduce the left side of the above equation by Lemma 3 and the right side is obviously , so we have:
[TABLE]
but since and , we can rewrite the above equation as:
[TABLE]
Note that by Lemma 1, the only values of are and , and raising these to the fourth power mod gives us:
[TABLE]
which is a contradiction. Thus, is irrational. This completes the proof.
We close by asking the obvious (and very difficult) question: Are and algebraic or transcendental? I suspect the latter, but it is only a hunch, and I hope some curious reader will continue along this interesting line of study.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] R. Euler and J. Sadek, A number that gives the unit digit of n n superscript 𝑛 𝑛 n^{n} , Journal of Recreational Mathematics , 29 (1998) No. 3, pp. 203–4.
