login
A189823
Decimal expansion of the reduced Champernowne constant.
2
1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 0, 1, 1, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 2, 0, 2, 1, 2, 2, 2, 4, 2, 5, 2, 6, 2, 7, 2, 8, 2, 9, 3, 0, 3, 2, 3, 3, 3, 5, 3, 6, 3, 7, 3, 8, 3, 9, 4, 0, 4, 3, 4, 4, 4, 6, 4, 7, 4, 8, 4, 9, 5, 0, 5, 4, 5, 5, 5, 7, 5, 8, 5, 9, 6, 0, 6, 5, 6, 6, 6, 8, 6, 9, 7, 0, 7, 6, 7, 7, 7, 9, 8, 0, 8, 7, 8, 8, 9, 0, 9, 9, 1, 0, 0, 1, 0, 2, 1, 0, 3, 1, 0, 4, 1, 0, 5, 1, 0, 6, 1, 0, 7, 1, 0, 8, 1, 0, 9, 1, 1, 0, 1, 1, 2, 1, 1, 4, 1, 1, 5, 1, 1, 6, 1, 1, 7, 1, 1, 8, 1, 1, 9, 1, 2, 0, 1, 2, 4, 1, 2, 5, 1, 2, 6, 1, 2, 7, 1, 2, 8, 1
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, 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
Cf. A033307, A325479 (similar but more compact).
Sequence in context: A333666 A033307 A007376 * A325479 A001073 A274580
KEYWORD
nonn,base,cons
AUTHOR
Laurent Signac, May 18 2011
STATUS
approved