OFFSET

0,2

COMMENTS

The Champernowne constant is 0.123456789101112131415161718192021222324... (all integers concatenated). Every integer can be found in the base 10 representation of this number.

Compare that to the reduced Champernowne constant, which is 0.12345678910111314151617181920212224... The decimal part is the concatenation of each successive integer if it is not already present in the sequence. By construction, the decimal expansion of this number also contains every integer.

Let's call C(k) the index of the beginning of k in the Champernowne constant and RC(k) the position index of the same integer in the reduced Champernowne constant.

Examples :

C(3) = 2 (0.123...) C(10) = 9 (0.12345678910) C(13) = 15 (0.12345678910111213) ...

RC(3) = 2 (0.123...) RC(10) = 9 (0.12345678910) RC(13) = 13 (0.123456789101113) ...

"Most" of the time RC(k) <= C(k).

The smallest k for which C(k) > RC(k) is 21:

Champernowne: 0.1234567891011121...

Reduced Champernowne: 0.1234567891011131415161718192021...

Values of k smaller than 500 for which C(k) > RC(k) are 21, 32, 43, 112, 121, 132, 142, 152, 162, 172, 182, 213, 221, 223, 231, 232, 243, 253, 263, 273, 283, 311, 312, 313, 324, 332, 334, 342, 343, 354, 364, 374, 384, 414, 422, 423, 424, 435, 445, 454, 465, 475, 485.

For each n, what is the percentage P(n) of k <= n such that C(k) > RC(k) ?

For all n between 20000 and 50000, 9.5% < P(n) < 10.3%.

LINKS

Laurent Signac, Table of n, a(n) for n = 0..10609

Laurent Signac, Nombre Univers

EXAMPLE

0.1234567891011... At this point in the Champernowne constant, we would append 12. But since "12" already occurred at the very beginning, for the reduced Champernowne constant, we move on to 13.

0.123456789101113141516171819202122... We don't append 23 because "23" already occurred (close to the beginning).

0.12345678910111314151617181920212224252627282930... We don't append 31 because "31" already occurred (from the concatenation of 13 and 14).

MATHEMATICA

redChamp = IntegerDigits[123456789]; For[n = 10, n < 500, n++, digits = IntegerDigits[n]; redChamp = Flatten[Append[redChamp, If[SequencePosition[redChamp, digits] == {}, digits, {}]]]]; redChamp (* Alonso del Arte, Sep 29 2019 *)

PROG

(Python)

def rchampernowne(n):

....stri=''

....for i in range(1, n+1) :

........if stri.count(str(i))==0 : stri=stri+str(i)

....return '0.'+stri+'...'

rchampernowne(100) # computes the decimal representation of the reduced Champernowne number until step 100 is reached. The computation of rchampernowne(n) ends when step n is reached, not when n appears in the decimal representation.

(Scala) var numerStr = ""

for (n <- 1 to 100) if (numerStr.indexOf(n.toString) == -1) numerStr = numerStr + n.toString

numerStr.split("").map(Integer.parseInt(_)).toList // Alonso del Arte, Nov 04 2019

CROSSREFS

KEYWORD

AUTHOR

Laurent Signac, May 18 2011

STATUS

approved