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.
%I A083833 #19 Dec 17 2024 17:13:39 %S A083833 1,2,22,121,131,222,2222,12021,12121,13031,13131,22222,222222,1202021, %T A083833 1203021,1212121,1213121,1302031,1303031,1312131,1313131,2222222, %U A083833 22222222,120202021,120212021,120303021,120313021,121202121,121212121 %N A083833 Palindromes p such that 5p + 1 is also a palindrome. %C A083833 From _Michael S. Branicky_, Jun 13 2021: (Start) %C A083833 All terms start and end with the digit 1, except those consisting of d 2's, which lead to palindromes of d+1 1's. %C A083833 If a(n) > 1 starts with 1, then its second and second-to-last digits are either both 2 or both 3; and if it has 5 or more digits, its third and third-to-last digits are either both 0 or both 1; thus, terms in the latter case only start with 120, 121, 130, 131, and 222. %C A083833 Using ^ to denote repeated concatenation, contains terms of the forms 2^d, leading to palindromes of the form 1^(d+1); (12)^d 1, leading to (60)^d 6; and (13)^d 1, leading to (65)^d 6; among other patterns. %C A083833 (Conjectures) %C A083833 All terms contain only the digits {0, 1, 2, 3}. %C A083833 For d even, the only term with d digits is 2^d; equivalently, all terms starting with 1 have odd length. (End) %H A083833 Michael S. Branicky, <a href="/A083833/b083833.txt">Table of n, a(n) for n = 1..8217</a> (all terms where p has <= 26 digits) %t A083833 Select[Range[23*10^5],AllTrue[{#,5#+1},PalindromeQ]&] (* The program generates the first 22 terms of the sequence. *) (* _Harvey P. Dale_, Dec 17 2024 *) %o A083833 (Python) %o A083833 from itertools import product %o A083833 def ispal(n): s = str(n); return s == s[::-1] %o A083833 def pals(d, base=10): # all positive d-digit palindromes %o A083833 digits = "".join(str(i) for i in range(base)) %o A083833 for p in product(digits, repeat=d//2): %o A083833 if d > 1 and p[0] == "0": continue %o A083833 left = "".join(p); right = left[::-1] %o A083833 for mid in [[""], digits][d%2]: %o A083833 t = int(left + mid + right) %o A083833 if t > 0: yield t %o A083833 def ok(pal): return ispal(5*pal+1) %o A083833 print([p for d in range(1, 10) for p in pals(d) if ok(p)]) # _Michael S. Branicky_, Jun 11 2021 %Y A083833 Cf. A083829, A083830, A083832, A083834. %K A083833 base,nonn %O A083833 1,2 %A A083833 _Amarnath Murthy_ and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 09 2003 %E A083833 Corrected and extended by _Ray Chandler_, May 21 2003