In any base $b$, $\forall n\in\mathbb{N}$ built from digits $\{1,2\}$, if you tally distinct digits in those $n^2$, finitely many have $\leq b/2$

101 Views Asked by At

E.g. let $f(n)$ be the $n$th largest natural number consisting of only digits $\{1,2\}$, written in base-10.

It appears from early data that for $1\leq k \leq 9$, there is a maximum $n$ such that the number of distinct digits in the base-10 value of $f(n)^2$ is $k$ or fewer.

It looks like the first several results are:

$$ \begin{array}{|l|l|l|l|} k & n & f(n) & f(n)^2 & \textrm{digits in }f(n)^2\\\hline 1 & 2 & 2 & 4 & \{4\} \\\hline 2 & 12 & 212 & 44944 & \{4,9\} \\\hline 3 & 52 & 21212 & 449948944 & \{4,8,9\} \\\hline 4 & 114 & 221122 & 48894938884 & \{3,4,8,9\} \\\hline 5 & 7336 & 221121212112 & 48894590445880095500544 & \{0,4,5,8,9\} \end{array} $$

I am curious whether my conjecture below can be proven true or false, (or failing that, 'likely to be true/false' is acceptable with reasoning).


Update

After a bunch of simulation, I conjecture that given any radix $r>2$ and sufficiently large $c$, then of all terms $n>c$ in base $r$ which consist only of digits in $\{1,2\}$, the count of distinct digits appearing in $n^2$ must be in the interval $$\left[\left\lfloor{\dfrac{r}{2}}\right\rfloor,r\right].$$

Unsurprisingly, it also appears that in the limit as $n\to\infty$, the number of distinct digits in $n^2$ will almost surely be $r$.

Probably the best specific case to look at is when $r=4$. For the first $\sim 3\times 10^8$ valid $n$, I show the following counts for $n$ yielding each $k$:

$$ \begin{array}{|l|l|l|l|} k & n\textrm{ count} & \max(f(n)) \\\hline 1 & 1 & 1_{4} \\\hline 2 & 4 & 2211_{4} \\\hline 3 & 591 & \infty \\\hline 4 & 316051761 & \infty \end{array} $$

$k=3$ terms seem to be growing very slowly and unpredictably.

Perhaps more relevant is $r=9$, which has the property that $k=5$ terms include every number of form $2^* \geq 222$, which I believe makes good sense from a quadratic residue point of view.

1

There are 1 best solutions below

2
On

For your general question, we have the infinite sequences $${\underbrace{33\ldots 33}_{n\text{ times}}}\,^2 ={\underbrace{11\ldots 11}_{n-1\text{ times}}}\,0\,{\underbrace{88\ldots 88}_{n-1\text{ times}}}\,9$$ and $${\underbrace{33\ldots 3}_{n-1\text{ times}}}\,4^2 ={\underbrace{11\ldots 11}_{n\text{ times}}}\,{\underbrace{55\ldots 55}_{n-1\text{ times}}}\,6$$