2
$\begingroup$

I ran into the following problem when I did scientific research.

Consider an infinite sequence $\{a_{i}\}$ for $p>u>0$. $a_{1}=0$. If $a_{i}\geq p$, $a_{i+1}=a_{i}-p$; otherwise, $a_{i+1}=a_{i}+u$. What is the average of this sequence?

I did some numerical experimentation and felt that the general formula for the average seems very complicated: it is neither monotone nor continuous in $(p,u)$.

$\endgroup$

1 Answer 1

17
$\begingroup$

By induction, $a_i=(p+u)\{i\frac{u}{p+u}\}$, where $\{x\}$ is a fractional part of $x$. Thus, by Weyl equidistribution theorem, if $p/u$ is irrational, the average equals $(p+u)/2$, otherwise $u/(p+u)=a/b$ for coprime positive integers $a, b$, and the average equals $(p+u) \frac{b-1}{2b}$.

$\endgroup$
2
  • $\begingroup$ Thank you, Fedor! This is really helpful! $\endgroup$
    – Peter
    Commented Aug 7 at 14:46
  • 2
    $\begingroup$ I believe writing it as $a_i = i \cdot u \bmod{(p+u)}$ would make it a bit clearer. $\endgroup$
    – Adayah
    Commented Aug 8 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.