login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A337159
Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, A033307(n + a(n)) = A033307(n).
1
0, 13, 14, 15, 16, 17, 18, 19, 20, 2, 40, 1, 3, 4, 21, 6, 33, 8, 51, 53, 60, 11, 80, 9, 100, 7, 120, 5, 140, 10, 160, 12, 157, 41, 163, 39, 23, 37, 31, 35, 49, 73, 67, 71, 85, 29, 103, 27, 121, 47, 141, 25, 137, 43, 143, 61, 144, 59, 145, 57, 45, 55, 63, 93
OFFSET
0,2
COMMENTS
This sequence is a permutation of the nonnegative integers: repunits induce runs of consecutive equal terms of arbitrary size in A033307, thus allowing any value to eventually occur.
PROG
(PARI) See Links section.
(Python)
def aupton(terms):
alst, A033307, last, used, n, an = [], '1', 1, set(), 0, 0
while n <= terms:
while an in used: an += 1
while len(A033307) <= n + an: last += 1; A033307 += str(last)
if A033307[n + an] == A033307[n]:
alst += [an]; used.add(an); n += 1; an = 0
else: an += 1
return alst
print(aupton(63)) # Michael S. Branicky, Jan 30 2021
CROSSREFS
Sequence in context: A371764 A004502 A020512 * A297275 A296745 A178402
KEYWORD
nonn,look,base
AUTHOR
Rémy Sigrist, Jan 30 2021
STATUS
approved