login
Nontrivial palindromes in base 10 (i.e., palindromes that are not RepDigits such as 3, 111, 22222, or 888888888).
3

%I #14 May 17 2022 11:25:12

%S 101,121,131,141,151,161,171,181,191,202,212,232,242,252,262,272,282,

%T 292,303,313,323,343,353,363,373,383,393,404,414,424,434,454,464,474,

%U 484,494,505,515,525,535,545,565,575,585,595,606,616,626,636,646,656,676

%N Nontrivial palindromes in base 10 (i.e., palindromes that are not RepDigits such as 3, 111, 22222, or 888888888).

%C The early portion of this sequence appears to be very similar to the early portions of two other sequences. Note that a(n) = A046075(n) for n = 1..81. A046075 deals with nontrivial undulants of 3 digits or more which by definition excludes RepDigits, but which includes non-palindromic terms when 4-digit numbers are reached. For example a(82) = 1001 but A046075(82) = 1010. Note also that a(n) = A050783(n+10) for n = 1..81. A050783 deals with palindromes that contain no consecutive pairs of equal digits, so although A050783 excludes RepDigits, it includes the single-digit palindromes and excludes a large number of the palindromes in this sequence (such as, for example, all the 4-digit nontrivial palindromes and larger nontrivial palindromes such as 22022 or 61116). A050783(92) = 10101. Note that in the first 65534 values of n there are 754 palindromes, 712 nontrivial palindromes and 42 RepDigits.

%H Michael S. Branicky, <a href="/A088882/b088882.txt">Table of n, a(n) for n = 1..10000</a>

%e a(4) = 141 because 141 is the fourth term of the sequence of base-10 palindromes (A002113) that does not appear in the sequence of RepDigits (A010785).

%o (Python)

%o from itertools import count, islice, product

%o def agen(): # generator of terms

%o digits = "0123456789"

%o for d in count(3):

%o for p in product(digits, repeat=d//2):

%o if d > 1 and p[0] == "0": continue

%o left = "".join(p); right = left[::-1]

%o for mid in [[""], digits][d%2]:

%o t = left + mid + right

%o if len(set(t)) != 1: yield int(t)

%o print(list(islice(agen(), 52))) # _Michael S. Branicky_, May 17 2022

%Y Cf. A002113 (base-10 palindromes), A010785 (repdigits), A046075 (nontrivial undulants), A050783 (palindromes with no pair of consecutive equal digits).

%K base,nonn

%O 1,1

%A Chuck Seggelin (barkeep(AT)plastereddragon.com), Oct 21 2003