# Cantor Ternary Set

I have two questions:

1. This is a more general question, how to find the periodicity, say of $1/252$ base 3?

2. The question is this: Find all $x$ such that both $x$ and $2x$ belong to the cantor set(CS).

Attempted Solution:

1. So, my idea is this: Let $x=.a_1a_2a_3...$ be its ternary expansion, then if $x$ belongs to the CS, $a_i\in\{0,2\}.$ However, since all the $a_i's$ in the ternary expansion of $x$ that are $2's$ will be $1's$ in the ternary expansion of $2x$, and since we want $2x$ to belong to the Cantor Set, then I think we are looking for all those numbers $x$ that have two different ternary expansions.

I think that all the numbers that are endpoints of the extracted intervals (i.e. $1/3, 1/9, 7/9$); that is all numbers of the form $m/3^k$ have two different ternary expansions. But I am not sure how to prove this last part??

Let $C$ be the middle-thirds Cantor set. Suppose that $$x=\sum_{n\ge 1}\frac{x_n}{3^n}\in C\;,$$ where each $x_n$ is either $0$ or $2$. For $n\ge 1$ let $y_n=x_n/2$; then $$\frac{x}2=\sum_{n\ge 1}\frac{y_n}{3^n}$$ belongs to $C$ if and only if $x=0$, or there is a sequence $\langle z_n:n\in\Bbb Z^+\rangle$ such that each $z_n$ is either $0$ or $2$, and $$\sum_{n\ge 1}\frac{z_n}{3^n}=\sum_{n\ge 1}\frac{y_n}{3^n}\;.$$

In other words, you’re right: apart from the special case $x=0$, $x/2$ has to have two ternary representations. This is the case if and only if there is an $m\in\Bbb Z^+$ such that:

• $z_m=1$, and $z_n=0$ for all $n>m$;
• $y_m=0$, and $y_n=2$ for all $n>m$; and
• $z_n=y_n=0$ for $1\le n<m$.

To prove this, suppose that $$r=\sum_{n\ge 1}\frac{z_n}{3^n}=\sum_{n\ge 1}\frac{y_n}{3^n}\;,$$ where each $z_n$ is $0$ or $2$ and each $y_n$ is $0$ or $1$. Let $m$ be the smallest positive integer such that $z_m\ne y_m$; then either $z_m=2$ and $y_m=0$, or $z_m=2$ and $y_m=1$.

Suppose that $z_m=2$ and $y_m=0$. Then $$\sum_{n\ge 1}\frac{z_n}{3^n}\ge\sum_{n=1}^{m-1}\frac{z_n}{3^n}+\frac2{3^m}\tag{1}\;,$$ but $$\sum_{n\ge 1}\frac{y_n}{3^n}\le\sum_{n=1}^{m-1}\frac{y_n}{3^n}+\sum_{n\ge m+1}\frac2{3^n}=\sum_{n=1}^{m-1}\frac{z_n}{3^n}+\frac1{3^m}<\sum_{n=1}^{m-1}\frac{z_n}{3^n}+\frac2{3^m}\le\sum_{n\ge 1}\frac{z_n}{3^n}\;,\tag{2}$$ which is a contradiction.

Thus, it must be the case that $z_m=2$ and $y_m=1$. From $(1)$ we know that $$r\ge\sum_{n=1}^{m-1}\frac{z_n}{3^n}+\frac2{3^m}\;.$$ A calculation very similar to $(2)$ shows that $$r\le\sum_{n=1}^{m-1}\frac{y_n}{3^n}+\frac1{3^m}+\sum_{n\ge m+1}\frac2{3^n}=\sum_{n=1}^{m-1}\frac{y_n}{3^n}+\frac1{3^m}+\frac1{3^m}=\sum_{n=1}^{m-1}\frac{z_n}{3^n}+\frac2{3^m}\;.\tag{3}$$ $(1)$ and $(3)$ together imply that $$r=\sum_{n=1}^{m-1}\frac{z_n}{3^n}+\frac2{3^m}\;,$$ so $z_n=0$ for $n>m$, and that $$r=\sum_{n=1}^{m-1}\frac{y_n}{3^n}+\frac1{3^m}+\sum_{n\ge m+1}\frac2{3^m}\;,$$ so that $y_n=2$ for $n>m$; any other values for any $z_n$ or $y_n$ with $n>m$ would make $\sum_{n\ge 1}\frac{z_n}{3^n}$ too large or $\sum_{n\ge 1}\frac{y_n}{3^n}$ too small, respectively. $\dashv$

These numbers $x/2$ are precisely the numbers of the form

$$\frac1{3^m}=\sum_{n>m}\frac2{3^n}\;,$$

the left endpoints of the leftmost intervals deleted at each stage. Note that a number like $\frac29$ does not have two ternary representation, even though its denominator is a power of $3$: its only representation is $0.02$.

This is an answer to the first question only. We take a slightly (but only slightly) more general approach than necessary.

First we simplify a bit. We have $252=(9)(28)$. So the base $3$ expansion of $\frac{1}{252}$ is obtained by finding the base $3$ expansion of $\frac{1}{28}$ and dividing by $9$, which means shifting by $2$ places to the right. Same idea as how to get the decimal expansion of $\frac{1}{700}$ from the decimal expansion of $\frac{1}{7}$.

The period of $\frac{1}{28}$ is the smallest positive integer $n$ such that $3^n\equiv 1 \pmod{28}$, that is, the smallest positive $n$ such that $3^n-1$ is divisible by $28$. So we want $3^n-1$ to be divisible by $4$ and by $7$.

The smallest positive integer $n$ such that $3^n-1$ is divisible by $7$ is $6$. Since $7$ is such a small number, this can be found by a short calculation modulo $7$. It is easy to see that $3^6-1$ is also divisible by $4$, so the period is $6$.

Remark: If we want to solve a similar problem about the base $3$ expansion of $\frac{1}{k}$, the same basic idea can be used. We can assume that $k$ is not divisible by $3$. Then we find the smallest $n$ such that $3^n\equiv 1\pmod{k}$. By general theory, this $n$ must divide $\varphi(k)$, where $\varphi$ is the Euler $\phi$-function. One can do better, and see that $n$ must divide $\lambda(k)$, where $\lambda$ is the Carmichael function. Still, for very large $k$, the computations may be very difficult.

For medium-sized $k$, we can simply divide $1$ by $k$ in base $3$, using ordinary "long division" (but in base $3$) until we observe a repetition in the remainders.

For problem 2, I suggest that you consider which consecutive pairs of digits such a number could contain. For example, it could conceivably contain the pair 00, but clearly it could not contain 20.

In general finding the periodicity of a rational number in base $n$ is easy but may require a time-consuming search. Say your number has denominator $3^kq$ where $q$ is not divisible by 3. Then the period in base 3 is the smallest positive integer $n$ such that $$3^n\equiv 1\pmod q.$$

By Fermat's theorem $n$ is at most $q$.

In general nobody knows a good way to find this $n$; it is believed that finding one is difficult when $q$ is large.

• Could you elaborate a little more on problem 2?? Thanks! – Briana Aug 30 '12 at 2:04
• What part would you like me to elaborate on? – MJD Aug 30 '12 at 2:14
• Would such numbers need to terminate on a sequence like $02222...$? I don't see how to incorporate the idea of consecutive pairs of digits? – Briana Aug 30 '12 at 2:32

Let the positions of 2 after the ternary radix point in $x$ occur in the ranges $a_k\leq n\leq b_k$ where $b_k<a_{k+1}-1$ for all $k\geq 1$, and zeros occur in all other positions. Then the ternary expansion of $2x$ has a 1 at positions $b_k$ and $a_k-1$, a 2 in ranges $a_k\leq n\leq b_k-1$, and a 0 elsewhere. Try using this.