Over the natural numbers, Euler's totient function $\phi(n)$ has the nice property that $\phi(n^m)=n^{m-1}\phi(n)$. I've found that this can naively extend the totient function over the rationals via: $$\phi(b)=\phi\left(\left(\frac{1}{b}\right)^{-1}\right)=\left(\frac{1}{b}\right)^{-2}\phi\left(\frac{1}{b}\right)=b^2\phi\left(\frac{1}{b}\right)$$ $$\implies\phi\left(\frac{1}{b}\right)=\frac{\phi(b)}{b^2}$$

Thus, with another property being that $\gcd(a,b)=1\implies \phi(ab)=\phi(a)\phi(b)$, then under the assumption that $\gcd(a,b)=1\implies\gcd\left(a,\frac{1}{b}\right)=1$, we can define


Note that this still preserves consistency over the natural numbers: $$\phi\left(\frac{a}{1}\right):=\frac{\phi(a)\phi(1)}{1^2}=\phi(a)$$

With this, I was immediately curious as to if a sequence of rational numbers $q_n$ converged to an irrational, would $\phi(q_n)$ also converge, and if so, to what?

As an initial test, I used the sequence $\pi_n=\sum_{k=0}^n\frac{4(-1)^k}{2k+1}$. Which, as you know, converges to $\pi$. I also tested the sequence $e_n=\sum_{k=0}^n\frac{1}{k!}$ (which converges to $e$, respectively). To my surprise, I found that with this definition of $\phi$, it seemed that both $\pi_n$ and $e_n$ converge.

totient of rationals converging to pi and e

The graph of $\phi(e_n)$ is in blue, and $\phi(\pi_n)$ in red. Curiously, (perhaps due to the closeness of $\pi\approx e$), they both seemingly approach a value of about $0.4$. That being said, my computer and I only had the patience to calculate the first $40$-ish terms, so I would very much like to know what the long-term behavior of the graph is.

Any insight would be very much appreciated.

Addendum: May 13th

With the feedback I've gathered in the comments, I've done some more analysis, which may be interesting to some of you. Specifically, it does not appear that the totient of all converging rational sequences converge. For example, with suggestions from Conifold, I tested the sequence of rationals defined by the continued fraction for the golden ratio. Which can be simplified to $\varphi_n=\frac{F_{n+1}}{F_n}$, where $F_n$ is the $n$'th Fibonacci number. It seemed evident from computational analysis that $\phi(\varphi_n)$ did not converge, however it seemed evident that $\limsup_{n\to\infty}\phi(\varphi_n)=\varphi=\frac{1+\sqrt{5}}{2}.$. The average and $\liminf$ also seemed to converge, however the $\limsup$ seemed to give more canonical results; on other sequences as well.

For the case of $\sqrt{2}$, it may be defined by $\phi(\sqrt{2})=2^{\frac{1}{2}-1}\phi(2)=\frac{\sqrt{2}}{2}$, which seemed to be exactly what the $\limsup$ converged to when taking the continued fraction for $\sqrt{2}$.

Lastly, and perhaps most curious, if we define $e_n:=\left(\frac{n+1}{n}\right)^n$ (as $\lim_{n\to\infty}e_n=e$), then, assuming my math is correct, we can deduce

$$L=\limsup{\phi(e_n)}=\limsup_{n\to\infty}{\phi\left(\left(\frac{n+1}{n}\right)^n\right)}=\limsup\left(\frac{n+1}{n}\right)^{n-1}\frac{\phi(n)\phi(n+1)}{n^2}$$ $$\implies \ln L = \limsup(n-1)\ln\left(\frac{n+1}{n}\right)+\ln\left(\frac{\phi(n)}{n}\right)+\ln\left(\frac{\phi(n+1)}{n}\right)$$ $$=1+\ln 1+\ln 1$$ $$\implies L=e$$

However in my computational analyses, It seemed that $\limsup \phi(e_n)\approx \frac{e}{2}$

I'm not sure what can be taken from this, however I do find these results interesting, so perhaps you will too.

  • 5
    $\begingroup$ This extension to $\mathbb{Q}$ has been looked at here before, see Is there a canonical extension of Euler's totient function to the reals? The answer is no, the limit, if any, depends on the approximating sequence chosen. $\endgroup$
    – Conifold
    May 13, 2021 at 6:54
  • $\begingroup$ @Conifold I concur. You would have to be rather optimistic for separate sequences that converge to say, $\pi$, to have $\phi$ converge similarly. Regardless, the fact that specific sequences may converge at all is my curiosity. $\endgroup$
    – Graviton
    May 13, 2021 at 7:33
  • $\begingroup$ Both these sequences are defined in a way not unrelated to the divisibility behavior of their numerators and denominators. Try this instead: 3, 3.1, 3.14, 3.141... $\endgroup$ May 13, 2021 at 7:52
  • 2
    $\begingroup$ One way to "canonize" it would be to take the limit over the sequence of convergents of their continued fractions, which is canonically determined and provides the "best" rational approximations. Their is a recursion for their numerators and denominators that may be helpful in exploring the limit behavior. Quadratic surds have particularly simple continued fractions, I'd be curious if $\phi$ converges for something like $\sqrt{2}$ or the golden ratio. $\endgroup$
    – Conifold
    May 13, 2021 at 8:14
  • 1
    $\begingroup$ It should be noted that in the other thread J.G. did not actually show the function cannot be extended to the reals by limits. He only showed that the limit at $0$ does not exist. But $0$ is a very special case for this function. So at this stage (with respect to just the information in these two threads), it is only a conjecture that the limits for irrationals do not converge. $\endgroup$ May 13, 2021 at 19:43

2 Answers 2


As mentioned in the comments, this analysis only really makes sense for series of rational numbers, since for any given real number there are convergent sequences of rationals whose images under this extended totient function don't converge. However, I'd like to give explanations for why some of this behavior arises.

Suppose $a/b\approx x$. How large can $\phi(a)\phi(b)/b^2$ can be?

Since $\phi(n)\le n$, we have that $\phi(a/b)\le ab/b^2 = a/b \approx x$, so the limsup as we go through convergents $a_n/b_n$ will never exceed $x$. When is the limsup exactly $x$? When, for arbitrarily large $a,b$, the numerator and denominator both lack any small prime factors, and so $\phi(a)/a$ and $\phi(b)/b$ are arbitrarily close to $1$.

In the case of $1.618\ldots$, adjacent Fibonacci numbers are always relatively prime, and can regularly avoid small prime factors, so we should expect the case where $\phi(a/b)\approx a/b$ to crop up regularly if there's no reason to expect it to fail. Thus, the limit is just $\phi$ itself.

I think you should expect this behavior in general, if you take something like continued fraction coefficients - if you treat the convergents as being drawn independently from successively larger and larger ranges, you should expect to randomly get $a$ and $b$ such that $\phi(a)/a$ and $\phi(b)/b$ are close to $1$ pretty often.

In the case of $\phi(e)$, your issue is in simplifying $\ln\left(\frac{\phi(n)}n\right)+\ln\left(\frac{\phi(n+1)}{n+1}\right)$ to $\ln(1)+\ln(1)$. While either of these individually have a limsup of 1, they do not have such a limsup together - one of $n$ and $n+1$ will always be even, and so you will always lose at least one factor of $2$. If there are infinitely many Sophie Germain primes $p$, then each successive value of $n=2p$ will get you closer and closer to that upper bound of $e/2$. (Proving that this really is the limsup might be quite difficult, though.)

Moving from limsups to limits:

The limiting values of $\phi\left(\sum_{k=1}^n\frac1{k!}\right)$ actually go to $0$, though they do so very slowly - the reason for this is that the sum of the first $n$ terms has $b=k!$, and $\phi(k!)/k! = (1-\frac12)(1-\frac13)\ldots(1-\frac1p)$, where $p$ is the greatest prime less than or equal to $k$. But since the sum of the reciprocal of the primes diverges, this infinite product will go to $0$. So the apparent convergence to $0.4$ is an artifact of the early truncation.

I believe a similar phenomenon occurs with $\pi_n$ (the denominator being a product of many many odd primes), but it seems a little harder to prove that some miraculous cancellation doesn't free up a bunch of factors from the denominator all at once. Barring such an occurrence, though, you should expect these terms to converge to $0$ as well, though again at a very slow rate (since the sum of the reciprocals of the primes increases very gradually, and the sum of the reciprocals of the primes up to n even slower than that).

  • $\begingroup$ +1. You might find some interest in my A. $\endgroup$ May 19, 2021 at 11:15
  • $\begingroup$ Fantastic insight, thanks for your time on this problem! $\endgroup$
    – Graviton
    May 20, 2021 at 7:52

Let $r\ge 1.$

By the Prime Number Theorem, if $0<d<1$ and $r>1$ then for all sufficiently large $x$ there is a prime in the interval $(xr,\, xr(1+d)].$

So let $c_n$ be an $odd$ prime with $c_n>n$ and let $a_n$ be prime with $c_nr< a_n\le c_nr(1+1/2n).$ Then $c_n\to\infty$ and $a_n\to \infty$ and $a_n/c_n\to r$ as $n\to\infty.$

Now let $b_n=c_n$ when $n$ is odd, and let $b_n=c_n-1$ when $n$ is even. For all $n$ we have $\gcd(a_n,b_n)=1.$ And $a_n/b_n\to r$ as $n\to\infty.$

When $n$ is odd we have $$\frac {\phi(a_n)\phi(b_n)}{b_n^2}=\frac {(a_n-1)(b_n-1)}{b_n^2} $$ which $\to r$ as $odd$ $n\to\infty.$

When $n$ is even then $b_n$ is even so $\phi (b_n)\le b_n/2,$ so $$\frac {\phi(a_n)\phi(b_n)}{b_n^2}=\frac {(a_n-1)\phi (b_n)}{b_n^2}\le$$ $$\le \frac {(a_n-1)b_n/2}{b_n^2}=\frac {a_n-1}{2b_n}$$ and the last expression above $\to r/2$ as $even$ $n\to\infty.$

So $\frac {\phi(a_n)\phi(b_n)}{b_n^2}$ does not converge.

  • $\begingroup$ The conseqience of the PNT that I cited can be proven without proving the full PNT but it is still non-trivial. $\endgroup$ May 19, 2021 at 11:19
  • $\begingroup$ Great work Daniel. This result is very interesting! $\endgroup$
    – Graviton
    May 20, 2021 at 7:57
  • $\begingroup$ For the case $r=1:$ Let $p_n$ be the nth prime.... (1). Let $b_n=p_n$ and $a_n=p_{n+1}.$ OR (2). Let $b_n=\prod_{j=1}^n p_j$ and $a_n=1+b_n.$ In either case, $\gcd (a_n, b_n)=1$ and $a_n/b_n\sim 1.$ In Case (1), $\phi (a_n)\phi (b_n)/b_n^2\sim 1.$ In Case (2), $\phi (a_n)\phi (b_n)/b_n^2\to 0$ because $\phi (b_n)/b_n\to 0.$ $\endgroup$ May 22, 2021 at 11:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .