cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A347400 Lexicographically earliest sequence of distinct terms > 0 such that concatenating n to a(n) forms a palindrome in base 10.

This page as a plain text file.
%I A347400 #7 Aug 30 2021 21:48:43
%S A347400 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 A347400 62,72,82,92,103,13,23,33,43,53,63,73,83,93,104,14,24,34,44,54,64,74,
%U A347400 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 A347400 Lexicographically earliest sequence of distinct terms > 0 such that concatenating n to a(n) forms a palindrome in base 10.
%e A347400 For n = 8 we have a(8) = 8 and 88 is a palindrome in base 10;
%e A347400 for n = 9 we have a(9) = 9 and 99 is a palindrome in base 10;
%e A347400 for n = 10 we have a(10) = 101 and 10101 is a palindrome in base 10;
%e A347400 for n = 11 we have a(11) = 11 and 1111 is a palindrome in base 10;
%e A347400 for n = 12 we have a(12) = 21 and 1221 is a palindrome in base 10; etc.
%o A347400 (Python)
%o A347400 def ispal(s): return s == s[::-1]
%o A347400 def aupton(terms):
%o A347400     alst, seen = [1], {1}
%o A347400     for n in range(2, terms+1):
%o A347400         an = 1
%o A347400         while an in seen or not ispal(str(n) + str(an)): an += 1
%o A347400         alst.append(an); seen.add(an)
%o A347400     return alst
%o A347400 print(aupton(200)) # _Michael S. Branicky_, Aug 30 2021
%Y A347400 Cf. A347335, A347336, A347401, A347402.
%K A347400 base,nonn
%O A347400 1,2
%A A347400 _Eric Angelini_ and _Carole Dubois_, Aug 30 2021