|
|
A371031
|
|
Number of distinct integers resulting from adding an n-digit non-multiple of 10 and its reverse.
|
|
1
|
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
FORMULA
|
For n > 1, empirically a(n+1) = 10 a(n) if n even, 19 a(n) / 10 if n odd, and thus a(n+2) = 19 a(n). - Michael S. Branicky, Mar 31 2024
|
|
EXAMPLE
|
For n=2 there are 81 2-digit numbers not ending with 0: {11, 12, 13, ..., 99}. There are 17 distinct results when adding each of these to their reversal: {22, 33, 44, 55, 66, 77, 88, 99, 110, 121, 132, 143, 154, 165, 176, 187, 198}. Therefore a(2) = 17.
|
|
MATHEMATICA
|
Module[{nn, ss},
nn = Select[Range[If[n == 1, 1, 10^(n - 1) + 1], 10^n - 1], Mod[#, 10] > 0 &];
ss = Map[# + FromDigits[Reverse[IntegerDigits[#]]] &, nn];
Return[CountDistinct[ss]]
];
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|