A367614 a(n) is the unique k such that n is the comma-successor of k, or -1 if k does not exist.
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, 30, 21, 12, 3, -1, -1, -1, -1, -1, -1, -1, 40, 31, 22, 13, 4, -1, -1, -1, -1, -1, -1, 50, 41, 32, 23, 14, -1, 5, -1, -1, -1, -1, 60, 51, 42, 33, -1, 24, 15, 6, -1, -1, -1, 70, 61, 52, -1, 43, 34, 25, 16, 7
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Programs
-
Python
def a(n): y = int(str(n)[0]) x = (n-y)%10 k = n - y - 10*x kk = k + 10*x + y-1 return k if k > 0 and int(str(kk)[0]) != y-1 else -1 print([a(n) for n in range(1, 86)]) # Michael S. Branicky, Dec 16 2023
Comments