# Find sum of all distinct numbers of the form 0.xyzxyzxyz

Given a number of the form $$0.xyzxyzxyz$$, where $$x,y,z$$ are distinct integers taking on values $$\in \{0,1,2, \ldots, 9\}$$, what is the sum, $$S$$, of all such numbers of the form $$0.xyzxyzxyz$$?

Here is how I solved this problem. For each $$x$$, there are 72 corresponding $$xyzxyzxyz$$ values. So each integer for $$x$$ will occur 72 times and similarly for $$y$$ and $$z$$. $$72 * \sum_{i=0}^9 i = 3240$$.

So the summation ends up looking something like $$324.000000000 + 32.400000000 + 3.240000000 + \ldots + 0.000003240 \\ \approx 360$$

The answer that was given said it is $$0.111111111 * 72 * \sum_{i=0}^9 i$$. Where did the $$0.111111111$$ come from? This approach is simpler than mine, but I just don't know where this decimal came from.

So it appears that the approach is very similar to mine, but they approached it from the form $$0.1 * 3240 + 0.01 * 3240 + 0.001 * 3240 + \ldots = 0.000000001 * 3240 = (0.1 + 0.01 + \ldots + 0.000000001) * 3240 = 0.111111111 * 3240$$

• For every block $xyz$ define the "conjugate" block $\overline {xyz}$ by replacing $x$ by $9-x$ and so on. Thus $\overline {391}=608$, for example. Then $.xyzxyzxyz+.\overline {xyzxyzxyz}=.999999999$. Now there are $5\times 9\times 8$ ways to choose $xyz$ with $x≤4$ so the answer is $.999999999\times 5\times 9\times 8$. That's at least similar to their method, – lulu Aug 30 '20 at 22:26
• Note: it's not clear (to me) whether you intended your decimal to repeat indefinitely. If you did, then of course my string $.999\cdots$ is just $1$. – lulu Aug 30 '20 at 22:29
• Oh, good call. It is certainly possible OP meant for this to be a terminating decimal. It doesn't change the analysis of the situation much in any event... just trim the decimals as necessary. – JMoravitz Aug 30 '20 at 22:33

The digit $$1$$ will occur in the $$x$$ positions precisely $$\frac{1}{10}$$ of the time. Similarly it will occur in the $$y$$ positions precisely $$\frac{1}{10}$$ of the time and same to for the $$z$$ positions.
The contribution of the $$1$$'s digit to the overall sum from a single term in the sum when it occurred in the $$x$$ position would be $$0.100100100100\cdots$$. Similarly in the $$y$$ position it would have contributed $$0.010010010010\cdots$$ and for the $$z$$ position as $$0.001001001\cdots$$. Note again that these each occur just as frequently as one another.
As there are $$10\times 9\times 8$$ ways to fill in the $$x$$'s, $$y$$'s and $$z$$'s such that they are all different digits, the total contribution of all of the $$1$$'s in the final summation who occurred in the $$x$$ position will be $$\frac{1}{10}\times 10\times 9\times 8\times 0.100100100\cdots$$ and in the $$y$$ position will be $$\frac{1}{10}\times 10\times 9\times 8\times 0.010010010\cdots$$ and similarly for the $$z$$ position.
Adding these together gives the total contribution of all $$1$$'s in the summation as $$72\times 0.1111111\cdots$$
The same argument applies for the total contribution of the $$2$$'s and $$3$$'s etc... yielding the final result
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 42, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9588572382926941, "perplexity": 154.12286466847553}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-10/segments/1614178373241.51/warc/CC-MAIN-20210305183324-20210305213324-00145.warc.gz"}