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 A380596 #22 Mar 06 2025 11:52:49 %S A380596 100,110,111,112,113,114,115,116,117,118,119,122,133,144,155,166,177, %T A380596 188,199,200,211,220,221,222,223,224,225,226,227,228,229,233,244,255, %U A380596 266,277,288,299,300,311,322,330,331,332,333,334,335,336,337,338,339,344,355,366,377,388,399 %N A380596 Numbers with embedded palindromes as proper substrings of the term. %C A380596 An embedded palindrome is a substring of at least two contiguous digits (since a single digit is trivially a palindrome). E.g., 121 is a palindrome, but has no embedded palindromes; 110 has the embedded palindrome "11". %C A380596 Alternatively, k contains a proper substring of the form dd or ded, where d and e are single decimal digits (i.e., a length-2 or -3 palindrome). - _Michael S. Branicky_, Feb 08 2025 %e A380596 100 is a term, since "00" is a palindrome; 1001 is a term for the same reason. %e A380596 1020 is a term, since "020" is a palindrome; 10201 is a term for the same reason. %o A380596 (Python) %o A380596 from itertools import combinations %o A380596 def get_all_substrings(string): %o A380596 length = len(string) + 1 %o A380596 return [string[x:y] for x, y in combinations(range(length), r=2)] %o A380596 def is_palindrome(n): %o A380596 return str(n) == str(n)[::-1] %o A380596 def ok(n): %o A380596 subsets = get_all_substrings(str(n)) %o A380596 subsets = [subset for subset in subsets if is_palindrome(subset) and len(subset)>1 and len(subset)<len(str(n))] %o A380596 return len(subsets)>0 %o A380596 print([k for k in range (100,400) if ok(k)]) %o A380596 (Python) %o A380596 def ok(n): %o A380596 s = str(n) %o A380596 return any(p == p[::-1] and len(p) < len(s) for p in (s[i:i+j] for j in (2, 3) for i in range(len(s)-j+1))) %o A380596 print([k for k in range(400) if ok(k)]) # _Michael S. Branicky_, Feb 08 2025 %Y A380596 Cf. A002113. %Y A380596 Significant overlap with A044821 for terms below 1000. %K A380596 nonn,base %O A380596 1,1 %A A380596 _James S. DeArmon_, Jan 27 2025