%I #7 Aug 30 2021 21:48:43
%S 1,2,3,4,5,6,7,8,9,101,11,21,31,41,51,61,71,81,91,102,12,22,32,42,52,
%T 62,72,82,92,103,13,23,33,43,53,63,73,83,93,104,14,24,34,44,54,64,74,
%U 84,94,105,15,25,35,45,55,65,75,85,95,106,16,26,36,46,56,66,76,86,96,107,17,27,37,47,57
%N Lexicographically earliest sequence of distinct terms > 0 such that concatenating n to a(n) forms a palindrome in base 10.
%e For n = 8 we have a(8) = 8 and 88 is a palindrome in base 10;
%e for n = 9 we have a(9) = 9 and 99 is a palindrome in base 10;
%e for n = 10 we have a(10) = 101 and 10101 is a palindrome in base 10;
%e for n = 11 we have a(11) = 11 and 1111 is a palindrome in base 10;
%e for n = 12 we have a(12) = 21 and 1221 is a palindrome in base 10; etc.
%o (Python)
%o def ispal(s): return s == s[::-1]
%o def aupton(terms):
%o alst, seen = [1], {1}
%o for n in range(2, terms+1):
%o an = 1
%o while an in seen or not ispal(str(n) + str(an)): an += 1
%o alst.append(an); seen.add(an)
%o return alst
%o print(aupton(200)) # _Michael S. Branicky_, Aug 30 2021
%Y Cf. A347335, A347336, A347401, A347402.
%K base,nonn
%O 1,2
%A _Eric Angelini_ and _Carole Dubois_, Aug 30 2021
|