login
A383189
Inverse permutation to A383187 (diamond spiral numbers of a king moving on the infinite two-dimensional grid, not to the point numbered a(n)+-1).
2
0, 3, 1, 6, 4, 15, 13, 2, 9, 7, 20, 5, 16, 35, 14, 31, 12, 10, 25, 8, 21, 42, 19, 17, 36, 63, 34, 32, 57, 30, 11, 26, 49, 24, 22, 43, 72, 41, 18, 37, 64, 99, 62, 33, 58, 91, 56, 29, 27, 50, 81, 48, 23, 44, 73, 110, 71, 40, 38, 65, 100, 143, 98, 61, 59, 92, 133, 90, 55, 28, 51, 82, 121, 80
OFFSET
0,2
PROG
(Python)
def A383189(n):
if not hasattr(A:=A383189, 'terms'): A.terms=[0]
while len(t := A.terms) <= n:
try: any(t.append(A383187.terms.index(k))for k in range(len(t), n+1))
except: A383187(len(getattr(A383187, 'terms', 0)+100))
return A.terms[n]
CROSSREFS
Cf. A383187 (inverse permutation).
Sequence in context: A007383 A206434 A340179 * A120394 A371667 A016575
KEYWORD
nonn
AUTHOR
M. F. Hasler, May 12 2025
STATUS
approved