A358985 a(n) is the number of numbers of the form k + reverse(k) for at least one n-digit number k.
10, 18, 180, 342, 3420, 6498, 64980, 123462, 1234620, 2345778, 23457780, 44569782, 445697820, 846825858, 8468258580, 16089691302, 160896913020, 305704134738, 3057041347380, 5808378560022, 58083785600220, 110359192640418, 1103591926404180, 2096824660167942
Offset: 1
Examples
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.
Links
- Paolo Xausa, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (0,19).
Programs
-
Mathematica
LinearRecurrence[{0, 19}, {10, 18, 180}, 30] (* Paolo Xausa, Oct 04 2024 *)
-
PARI
a(n) = (18+(n<2))*19^(n\2-1)*10^(n%2); \\ Jinyuan Wang, Dec 14 2022
-
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
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
Extensions
More terms from Jinyuan Wang, Dec 14 2022