OFFSET
1,1
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,19).
FORMULA
a(2n+1) = 10*a(2n) for n > 0. - Chai Wah Wu, Dec 09 2022
a(2n) = 19*a(2n-2) for n > 1. - Robert G. Wilson v, Dec 10 2022
a(n) = 19*a(n-2). - Wesley Ivan Hurt, Mar 17 2023
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, so a(2) = 18.
MATHEMATICA
LinearRecurrence[{0, 19}, {10, 18, 180}, 30] (* Paolo Xausa, Oct 04 2024 *)
PROG
(Python)
def A358985(n):
if n == 1:
return 10
kset = set()
for i in range(10**(n-2), 10**(n-1)):
for j in range(int((s:=str(i))[0])+1):
kset.add(10*i+j+int(str(j)+s[::-1]))
return len(kset) # Chai Wah Wu, Dec 09 2022
(PARI) a(n) = (18+(n<2))*19^(n\2-1)*10^(n%2); \\ Jinyuan Wang, Dec 14 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jon E. Schoenfield, Dec 08 2022
EXTENSIONS
More terms from Jinyuan Wang, Dec 14 2022
STATUS
approved