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-2 of 2 results.

A031297 a(n) is the least k such that the base-10 representation of n begins at s(k), where s=A007376.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 1, 16, 18, 20, 22, 24, 26, 28, 30, 15, 34, 2, 38, 40, 42, 44, 46, 48, 50, 17, 37, 56, 3, 60, 62, 64, 66, 68, 70, 19, 39, 59, 78, 4, 82, 84, 86, 88, 90, 21, 41, 61, 81, 100, 5, 104, 106, 108, 110, 23, 43, 63, 83
Offset: 1

Views

Author

Keywords

Comments

A229186 is the same sequence including the a(0) term.

Examples

			a(1) = a(12) = a(123) = 1 since they each start at index 1 in 0123.
a(21) = 15 since it appears first at index 15 in 012345678910111213.
		

Crossrefs

Cf. A007376, A229186 (same sequence but including the a(0) term).
Cf. A165449.
Cf. A030304 (binary variant).

Programs

  • Maple
    with(StringTools): s:="": for n from 1 to 70 do s:=cat(s,convert(n,string)): od: seq(Search(convert(n, string), s), n=1..70); # Nathaniel Johnston, May 26 2011
  • Mathematica
    nmax = 100;
    s = Table[IntegerDigits[n], {n, 0, nmax}] // Flatten;
    a[n_] := SequencePosition[s, IntegerDigits[n], 1][[1, 1]] - 1;
    Array[a, nmax] (* Jean-François Alcover, Feb 21 2021 *)
  • Python
    from itertools import count, islice
    def agen():
        k, chap = 0, "0"
        for n in count(1):
            target = str(n)
            while chap.find(target) == -1: k += 1; chap += str(k)
            yield chap.find(target)
    print(list(islice(agen(), 70))) # Michael S. Branicky, Oct 06 2022

A229190 Beginning position of n in the decimal expansion of the Copeland-Erdos constant.

Original entry on oeis.org

48, 5, 1, 2, 21, 3, 31, 4, 41, 12, 47, 5, 62, 7, 22, 77, 32, 9, 95, 11, 589, 110, 113, 1, 128, 131, 137, 63, 149, 15, 158, 8, 14, 123, 24, 2, 188, 19, 42, 72, 206, 21, 215, 23, 227, 233, 236, 25, 248, 75, 257, 78
Offset: 0

Views

Author

Eric W. Weisstein, Sep 15 2013

Keywords

Comments

Same as A165449 but including the a(0) term.

Crossrefs

Cf. A033308 (decimal expansion of the Copeland-Erdos constant).
Cf. A165449 (same sequence but omitting the a(0) term).

Programs

  • Python
    from sympy import primerange
    from itertools import count, takewhile
    def afind(plimit):
      s = "".join(str(p) for p in primerange(1, plimit+1))
      return [1+s.find(str(n)) for n in takewhile(lambda i: str(i) in s, count(0))]
    print(afind(10**4)) # Michael S. Branicky, May 01 2021
Showing 1-2 of 2 results.