OFFSET

1,1

COMMENTS

This sequence differs from the partial sums of A358985; see the Example section.

EXAMPLE

There are 10 numbers of the form k + reverse(k) for 1-digit numbers k -- 0, 2, 4, 6, 8, 10, 12, 14, 16, and 18 -- so a(1) = 10.

There are 18 numbers of the form k + reverse(k) for 2-digit numbers k -- 11, 22, 33, 44, 55, 66, 77, 88, 99, 110, 121, 132, 143, 154, 165, 176, 187, and 198 -- and none of these 18 numbers are among the 10 numbers counted in a(1), so a(2) = 10 + 18 = 28.

There are 180 numbers of the form k + reverse(k) for 3-digit numbers k, but exactly one of those -- 121 = 110 + reverse(110) = 110 + 11 -- is also a number of the form k + reverse(k) for a 2-digit number k: e.g., 29 + reverse(29) = 29 + 92 = 121. So a(3) = 10 + 18 + 180 - 1 = 207.

PROG

(Python)

def A358986(n):

kset = set()

for i in range(1, 10**(n-1)):

for j in range(int((s:=str(i))[0])+1):

kset.add(10*i+j+int(str(j)+s[::-1]))

return 10+len(kset) # Chai Wah Wu, Dec 09 2022

CROSSREFS

KEYWORD

nonn,base,more

AUTHOR

Jon E. Schoenfield, Dec 08 2022

EXTENSIONS

a(8)-a(10) from Chai Wah Wu, Dec 09 2022

STATUS

approved