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.

A300062 a(1) = 1, a(n) = the smallest integer > a(n-1) such that Sum_{k=1..n} a(k) written in decimal contains decimal n as a substring.

Original entry on oeis.org

1, 11, 18, 19, 26, 31, 41, 42, 50, 71, 101, 201, 301, 401, 501, 601, 701, 801, 901, 1001, 1101, 1201, 1301, 1401, 1426, 1476, 1501, 1601, 1701, 1771, 1831, 1901, 2001, 2101, 2201, 2301, 2401, 2501, 2601, 2701, 2801, 2901, 3001, 3101, 3201, 3301, 3324, 3378, 3401
Offset: 1

Views

Author

Chai Wah Wu, Feb 23 2018

Keywords

Comments

1 contains 1 as a substring.
1 + 11 = 12 contains 2 as a substring and 11 is the least number > 1 that does that.
1 + 11 + 18 = 30 contains 3 as a substring and 18 is the least number > 11 that does that.
1 + 11 + 18 + 19 = 49 contains 4 as a substring and 19 is the least number > 18 that does that.
In the first 10000 terms the distribution of the least significant digit {0-9} is {201, 8339, 189, 185, 184, 174, 183, 176, 179, 190}. - Robert G. Wilson v, Feb 24 2018

Crossrefs

Cf. A162555.

Programs

  • Mathematica
    f[lst_List] := Block[{k = 1 + lst[[-1]], n = ToString[1 + Length@lst], s = Plus @@ lst}, While[StringPosition[ToString[s + k], n] == {}, k++]; Append[lst, k]]; Nest[f, {1}, 50] (* Robert G. Wilson v, Feb 24 2018 *)
  • Python
    A300062_list, s, j = [1], 1, 1
    for i in range(2,10001):
        j, si = j + 1, str(i)
        while si not in str(s+j):
            j += 1
        A300062_list.append(j)
        s += j