# Interesting function generated by one irrational number as seed value

Here is an interesting and entertaining math subject. Over the last year I have been exploring it a bit, both analytically and numerically. I hope the reader enjoys it aswell.

Choose an arbitrary positive or negative irrational number X as starting value. E.g. X = e, or -pi or log(2).

In the further process only the non-integral part of X plays a role. So by adding or substracting a natural number we adjust X until it is a real number in the open interval (0,1). In other words, we actually use e-2, 4-pi, pi-3 etc.

Now we construct an infinite sequence Y(n) [n=1,2,3,4...] by multiplying the seed value X by n and then taken the non-integral part. In formula form this reads:

y(n) = n*X - int(n*X) for n = 1,2,3,4......

The Y(n) are real numbers in the interval (0,1). Importantly all Y(n) are strictly unequal to 0 and also unequal to 1. This is a direct consequence of our choice of X as an irrational number. Hence we can safely take the reciprocal of Y(n) and/or 1-Y(n):

f(n) = 1/y(n)

g(n) = 1/(1-y(n))

For all seed values X and indices n these f(n) and g(n) are positive, finite, unbounded real numbers larger than 1. Since their values jump around a bit too wildly, it is useful to construct the running averages F(n) and G(n) of these two functions.

F(n) = (1/n) * {f(1) + f(2) + .... + f(n)}

G(n) = (1/n) * {g(1) + g(2) + .... + g(n)}

In my humble opinion these two functions are rich in content, hence well worth exploring!

The first question is how F(n) and G(n) behave in the limit of n to infinity. Already this question leads to an amusing little paradox. On the one hand one may argue that since every f(n) and g(n) is finite, their average must obviously be finite aswell. Yet on the other hand one can point to the fact that the y(n) form a discrete, pseudo-random, almost perfectly homogeneous, dense subset of the interval (0,1). So in very good approximation one can replace the summation by an integration. Now the primitive function is the logarithm, log(y) or log(1-y), and both of them diverge when evaluated at the boundaries of the interval (the first diverges at y=0 and the second at y=1). Now a logarithmic divergence is very weak, but nevertheless it is a divergence. So there is your paradox...!! Numerical tests suggest that in the limit of n to infinity the F(n) and G(n) actually remain finite; they do not converge to a fixed value, but continue to fluctuate in a pseudo-random way.

F(n) and G(n) are for the majority of the time a descending function. I.e. f(n) < f(n-1) for most n. The instances of increase are less frequent, and occur when y(n) is very close to either 0 or 1. Then the function experiences a sharp spike. This is followed by a period of decay (which can be demonstrated to be a hyperbolic in nature). Thus F(n) and G(n) can be considered a pseudo-random of sequence of pulse trains, followed by hyperbolic decay. Obviously there is a spectrum of these positive pulses. Very large pulses are rare, small pulses are rather common. This can be understood with a probabilistic argument. Since the values of y are nearly homogeneous, any small value y=epsilon will typically occur with a frequency of n=1/epsilon.

The difference of F(n) and G(n) provides information of whether the y(n) has more near-zero or more near-one occurrances. Obviously a considerable amount of balancing takes place. Still the difference does not necessarily approach zero. This is kind of similar to the amusing subject of prime races, where one counts prime numbers of category 4*k+1 versus 4*k+3. Actually my interest in prime races led me to construct this (much more simple) math puzzle.

I welcome all comments on this subject !

-
"On the one hand one may argue that since every f(n) and g(n) is finite, their average must obviously be finite." This is false. For example, take $f(n) = n$. Anyway, the behavior of $y(n)$ is closely related to the problem of how accurately $X$ may be approximated by rational numbers, which is related to its continued fraction expansion (en.wikipedia.org/wiki/Continued_fraction) and is studied in the theory of Diophantine approximation (en.wikipedia.org/wiki/Diophantine_approximation). – Qiaochu Yuan May 15 '12 at 16:31
Somewhat apropos... – J. M. May 15 '12 at 16:35
@Qiaochu Yuan. Sorry, I don't understand your "this is false" claim, supposedly demonstrated by taking f(n) = n. It seems to me this yields F(n) = 0.5*(n+1). Nothing wrong with that. – M. Wind May 15 '12 at 18:44