cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-4 of 4 results.

A337227 a(n) = difference between the starting positions of the first two occurrences of n in the Champernowne string (starting at 0) 01234567891011121314151617181920... (cf. A033307).

Original entry on oeis.org

11, 9, 13, 14, 15, 16, 17, 18, 19, 20, 180, 1, 19, 37, 55, 73, 91, 109, 127, 145, 221, 166, 1, 19, 37, 55, 73, 91, 109, 127, 231, 149, 233, 1, 19, 37, 55, 73, 91, 109, 241, 132, 243, 244, 1, 19, 37, 55, 73, 91, 251, 115, 253, 254, 255, 1, 19, 37, 55, 73, 261, 98, 263, 264, 265, 266, 1, 19
Offset: 0

Views

Author

Keywords

Comments

Consider the infinite string
01234567891011121314151617181920... (cf. A033307)
formed by the concatenation of all decimal digits of all nonnegative numbers. From the position of the first digit of the first occurrence of the number n find the number of digits one has to move forward to get to the start of the second occurrence of n. This is a(n).

Examples

			The infinite string corresponding to the concatenation of all decimal digits >=0 starts "012345678910111213141516171819202122232425....".
a(0) = 11 because '0' appears at positions 1 and 12.
a(1) = 9 because '1' appears at positions 2 and 11.
a(10) = 180 because '10' appears starting at positions 11 and 191.
a(11) = 1 because '11' appears starting at positions 13 and 14.
		

Crossrefs

Programs

  • Python
    from itertools import count
    def A337227(n):
        s1 = tuple(int(d) for d in str(n))
        s2 = s1
        for i, s in enumerate(int(d) for k in count(n+1) for d in str(k)):
            s2 = s2[1:]+(s,)
            if s2 == s1:
                return i+1 # Chai Wah Wu, Feb 18 2022

A342162 a(n) = difference between the starting positions of the first two occurrences of n in the Champernowne string (cf. A033307), where the first n is not required to be at its natural position.

Original entry on oeis.org

11, 9, 13, 14, 15, 16, 17, 18, 19, 20, 180, 1, 13, 37, 55, 73, 91, 109, 127, 145, 221, 17, 1, 34, 37, 55, 73, 91, 109, 127, 231, 35, 17, 1, 55, 37, 55, 73, 91, 109, 241, 53, 35, 17, 1, 76, 37, 55, 73, 91, 251, 71, 53, 35, 17, 1, 97, 37, 55, 73, 261, 89, 71, 53, 35, 17, 1, 118, 37, 55, 271, 107
Offset: 0

Views

Author

Scott R. Shannon, Mar 03 2021

Keywords

Comments

Consider the infinite string 01234567891011121314151617181920... (cf. A033307) formed by the concatenation of all decimal digits of all nonnegative numbers. From the position of the first digit of the first occurrence of the number n, which is not required to be at its natural position in the string, find the number of digits one has to move forward to get to the start of the second occurrence of n. This is a(n).
This sequence is similar to A337227 but here the first appearance of n can be anywhere in string. The first example where n appears before its natural position in the string is n = 12. See the examples.

Examples

			a(0) = 11 as the string '0' first appears at position 1 and again at position 12, giving a difference of 11.
a(10) = 180 as the string '10' first appears at position 11 and again at position 191 (where it forms the start of the number 100), giving a difference of 180.
a(12) = 13 as the string '12' first appears at position 2 (the first number to appear before its natural position) and again at position 15 (its natural position), giving a difference of 13. This is the first term to differ from A337227.
		

Crossrefs

Programs

  • Python
    from itertools import count
    def A342162(n):
        s1, s2, m = tuple(int(d) for d in str(n)), tuple(), -1
        l = len(s1)
        for i, s in enumerate(int(d) for k in count(0) for d in str(k)):
            s2 = (s2+(s,))[-l:]
            if s2 == s1:
                if m >= 0:
                    return i-m
                m = i # Chai Wah Wu, Feb 18 2022

A343102 a(n) is the sum of the number of times the digits in n (without repetition) have appeared in the sequence.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 1, 2, 2, 2, 2, 2, 2, 2, 2, 19, 11, 8, 8, 8, 8, 8, 8, 14, 9, 11, 8, 8, 0, 1, 0, 0, 0, 8, 2, 16, 11, 10, 1, 1, 1, 2, 1, 10, 3, 17, 19, 10, 1, 1, 0, 1, 1, 9, 4, 20, 26, 14, 3, 5, 3, 2, 3, 11, 6, 21, 30, 15, 6, 4, 3, 5, 1, 10, 5, 31, 42, 24, 16, 15, 14, 14, 10
Offset: 0

Views

Author

Scott R. Shannon, Apr 05 2021

Keywords

Comments

The fixed points > 0 in the first one million terms are 10, 310, 341, 351, 514. It is likely no more exist.

Examples

			a(0) to a(9) = 0 as the digits 0 to 9 have not appeared in the sequence.
a(10) = 10 as 1 has not appeared while 0 has appeared ten times, thus a(10) = 0 + 10 = 10.
a(11) = 1 as the repetitions of 1 in 11 are ignored, and 1 has appeared once in the sequence.
a(12) = 2 as 1 has appeared twice while 2 has not appeared, thus a(12) = 2 + 0 = 2.
a(20) = 19 as 2 has appeared eight times while 0 has appeared eleven times, thus a(20) = 8 + 11 = 19.
a(22) = 8 as the repetitions of 2 in 22 are ignored, and 2 has appeared eight times in the sequence.
		

Crossrefs

Cf. A343103 (count all digits in n), A326834, A004207, A309261, A331162.

Programs

  • Mathematica
    Block[{a = {}, d = ConstantArray[0, 10]}, Do[AppendTo[a, Total@ Map[d[[If[# == 0, 10, #] ]] &, Union@ IntegerDigits[i]]]; Set[d, d + DigitCount[a[[i + 1]] ]], {i, 0, 87}]; a] (* Michael De Vlieger, Apr 05 2021 *)

A343103 a(n) is the sum of the number of times each digit in n (taken with repetition) has appeared in the sequence.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 2, 2, 1, 2, 2, 2, 2, 2, 2, 19, 11, 16, 8, 8, 8, 9, 8, 12, 11, 11, 11, 9, 0, 0, 0, 1, 0, 4, 3, 16, 16, 10, 2, 2, 1, 4, 2, 6, 5, 17, 20, 14, 2, 4, 2, 5, 3, 6, 5, 22, 25, 23, 8, 9, 9, 10, 6, 11, 11, 19, 27, 22, 5, 6, 7, 10, 6, 8, 9, 25, 33, 29, 11, 10, 12, 14, 9
Offset: 0

Views

Author

Scott R. Shannon, Apr 05 2021

Keywords

Comments

The fixed points > 0 in the first one million terms are 10, 101, 194. It is likely no more exist.

Examples

			a(0) to a(9) = 0 as the digits 0 to 9 have not appeared in the sequence.
a(10) = 10 as 1 has appeared zero times and 0 has appeared ten times, thus a(10) = 0 + 10 = 10.
a(11) = 2 as 1 has appeared once in the sequence, and as 1 appears twice in 11, a(11) = 1 + 1 = 2.
a(12) = 2 as 1 has appeared twice and 2 has appeared zero times, thus a(12) = 2 + 0 = 2.
a(20) = 19 as 2 has appeared eight times and 0 has appeared eleven times, thus a(20) = 8 + 11 = 19.
a(22) = 16 as 2 has appeared eight times in the sequence, and as 2 appears twice in 22, a(22) = 8 + 8 = 16.
		

Crossrefs

Cf. A343102 (count only unique digits in n), A326834, A004207, A309261, A331162.

Programs

  • Mathematica
    Block[{a = {}, d = ConstantArray[0, 10]}, Do[AppendTo[a, Total@ Map[d[[If[# == 0, 10, #] ]] &, IntegerDigits[i]]]; Set[d, d + DigitCount[a[[i + 1]] ]], {i, 0, 87}]; a] (* Michael De Vlieger, Apr 05 2021 *)
Showing 1-4 of 4 results.