Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a non-constant, continuous function $f: \mathbb{R} \longrightarrow \mathbb{R}$ such that for all integers $n$, $f$ is $2^n$-periodic?


  1. $n$ can be any integer, and so can be negative as well as positive.
  2. If I did not require $f$ to be continuous, then I think $f: \mathbb{R} \longrightarrow \mathbb{R}$ defined by: $$f(x) = \begin{cases} 1 & \text{$x$ rational} \\ 0 & \text{$x$ irrational} \end{cases}$$ would do the trick.
share|cite|improve this question
Thanks Thomas . – Adam Rubinson Sep 7 '12 at 23:24
up vote 8 down vote accepted

No, such a function does not exist. Assume there are two points $x,y$ with $f(x)=a, f(y)=b, a \ne b$. The points with function value $a$ are dense in the real line because they include all offsets by any dyadic rational, so I can find one arbitrarily close to $y$.

Added: we can characterize the $2^n$ periodic functions. Define an equivalence relation on $\mathbb R$ by $x \sim y$ if $x-y$ is a dyadic rational. There are continuum many classes, each countable and dense. The function must be constant on any given class, but there is no restriction between the classes. That means there are as many $2^n$ periodic functions as all functions from $\mathbb R$ to $\mathbb R$

share|cite|improve this answer

No such function exists. Suppose $f$ is non-constant, so we have some $a<b$ and $\epsilon>0$ such that $|f(a)-f(b)|>\epsilon$. By continuity, we have some $\delta>0$ such that $|x-y|<\delta\implies |f(x)-f(y)|<\epsilon$. Let $n\in\mathbb Z$ be such that $2^n<\delta$, and let $m=\lfloor|a-b|/2^n\rfloor$. Then we have $$\begin{align} |f(a)-f(b)|&\leq |f(a)-f(a+2^n)|+|f(a+2^n)-f(a+2\cdot 2^n)|+\cdots+|f(a+m\cdot 2^n)-f(b)|\\ &\leq |f(a+m\cdot 2^n)-f(b)|<\epsilon\\ \end{align}$$ which is a contradiction.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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