A337159 Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, A033307(n + a(n)) = A033307(n).
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
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..10000
- Rémy Sigrist, Scatterplot of the first 10000 terms
- Rémy Sigrist, PARI program for A337159
- Index entries for sequences that are permutations of the natural numbers
Programs
-
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
Comments