Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #14 Dec 09 2022 10:53:32
%S 10,28,207,548,3966,10462,75435,198890,1433489,3779246
%N a(n) is the number of numbers of the form k + reverse(k) for at least one number k < 10^n.
%C This sequence differs from the partial sums of A358985; see the Example section.
%e 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.
%e 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.
%e 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.
%o (Python)
%o def A358986(n):
%o kset = set()
%o for i in range(1,10**(n-1)):
%o for j in range(int((s:=str(i))[0])+1):
%o kset.add(10*i+j+int(str(j)+s[::-1]))
%o return 10+len(kset) # _Chai Wah Wu_, Dec 09 2022
%Y Cf. A067030, A358985.
%K nonn,base,more
%O 1,1
%A _Jon E. Schoenfield_, Dec 08 2022
%E a(8)-a(10) from _Chai Wah Wu_, Dec 09 2022