%I #21 Dec 01 2019 23:14:22
%S 1,10,11,2,20,21,12,13,3,30,31,14,4,40,41,15,5,50,51,16,6,60,61,17,7,
%T 70,71,18,8,80,81,19,9,90,91,92,22,23,24,25,26,27,28,29,93,32,33,34,
%U 35,36,37,38,39,94,42,43,44,45,46,47,48,49,95,52,53,54,55,56,57,58,59,96,62,63,64
%N Lexicographically earliest sequence of distinct positive terms such that the digits of a(n) together with the first digit of a(n+1) can be arranged to form a base-10 palindrome.
%C The sequence starts with a(1) = 1 and is always extended with the smallest integer not present that doesn't lead to a contradiction.
%C Comment from _N. J. A. Sloane_, Apr 27 2018: (Start)
%C It is not difficult to prove that a(n+1) always exists. As in the proof that A228407 contains every number, classify numbers m into 2^10 classes according to the parity of the numbers of 0's, 1's, ..., 9's they contain. Let W(m) denote the binary weight of the class that m belongs to.
%C A necessary and sufficient condition for there to exist a digit x such that the digits of a(n) and x can be rearranged to form a palindrome is that W(a(n)) = 0 or 1. If W(a(n)) = 0 then x can be any nonzero digit, while if W(a(n)) = 1 then x can be chosen to be the digit that appears an odd number of times in a(n), as long as that digit is not zero.
%C We now choose a(n+1) to begin with x, and choose the remaining digits of a(n+1) so that the digits of a(n+1) again have the required property. (End)
%H Jean-Marc Falcoz, <a href="/A303501/b303501.txt">Table of n, a(n) for n = 1..10001</a>
%e The digit of a(1) = 1 together with the 1 of a(2) = 10 forms 11;
%e the digits of a(2) = 10 together with the 1 of a(3) = 11 form 101;
%e the digits of a(3) = 11 together with the 2 of a(4) = 2 form 121;
%e the digit of a(4) = 2 together with the 2 of a(5) = 20 forms 22;
%e the digits of a(5) = 20 together with the 2 of a(6) = 21 form 202;
%e the digits of a(6) = 21 together with the 1 of a(7) = 12 form 121;
%e the digits of a(7) = 12 together with the 1 of a(8) = 13 form 121;
%e the digits of a(8) = 13 together with the 3 of a(9) = 3 form 313;
%e etc.
%Y Cf. A002113 (Palindromes in base 10).
%Y The palindromes arising here are listed in A303570.
%K nonn,base
%O 1,2
%A _Eric Angelini_ and _Jean-Marc Falcoz_, Apr 25 2018