login
A162555
a(n) = the smallest positive integer not occurring earlier in the sequence such that Sum_{k=1..n} a(k) written in decimal contains decimal n as a substring.
2
1, 11, 18, 4, 16, 6, 14, 8, 12, 10, 13, 7, 15, 5, 17, 3, 19, 2, 9, 30, 101, 201, 301, 401, 26, 76, 501, 453, 49, 601, 170, 32, 168, 34, 20, 82, 264, 38, 162, 40, 160, 42, 158, 44, 106, 96, 154, 48, 152, 50, 150, 52, 148, 54, 146, 56, 21, 81, 242, 60, 140, 62, 138, 64, 136
OFFSET
1,2
COMMENTS
A permutation of the positive integers. - M. F. Hasler, Mar 05 2018
EXAMPLE
a(3) = 18 because that makes the sum of the first 3 terms 30, containing a substring of "3." 11 would make a sum of 23, but 11 was already used in a(2).
PROG
(Python)
A162555_list, A162555_set, s = [], set(), 0
for i in range(1, 10001):
j, si = 1, str(i)
while si not in str(s+j) or j in A162555_set:
j += 1
A162555_list.append(j)
A162555_set.add(j)
s += j # Chai Wah Wu, Feb 23 2018
CROSSREFS
Cf. A160855 for the same concept using strings of binary for the sum and substring.
See A300062 for a strictly increasing variant.
Sequence in context: A065706 A078874 A257169 * A059141 A072967 A232658
KEYWORD
nonn,base,look
AUTHOR
Kerry Mitchell, Jul 06 2009
STATUS
approved