login

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”).

A358985
a(n) is the number of numbers of the form k + reverse(k) for at least one n-digit number k.
4
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,1
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
Sequence in context: A288781 A233451 A177172 * A171767 A153689 A240022
KEYWORD
nonn,base
AUTHOR
Jon E. Schoenfield, Dec 08 2022
EXTENSIONS
More terms from Jinyuan Wang, Dec 14 2022
STATUS
approved