A303050 Number of 2n-digit decimal numbers without leading zeros where each digit appears an even number of times.
9, 252, 10944, 617472, 41457024, 3141499392, 259346018304, 22749987520512, 2082519895670784, 196336888097144832, 18885576885968830464, 1841197721072909156352, 181107406524439376953344, 17918621160090649673859072, 1779590652288735614991335424
Offset: 1
Examples
For n=1, the a(1)=9 numbers are 11, 22, 33, ..., 88, 99. For n=2, the a(2)=252 numbers are 1001, 1010, 1100, 1111, 1122, 1212, 1221, ..., 9988, 9999.
Links
- T. V. Raziman, Table of n, a(n) for n = 1..30
- Quora, How many 2n digit numbers are there such that each digit is repeated even (possibly 0) times?
- Index entries for linear recurrences with constant coefficients, signature (220,-16368,489280,-5395456,14745600).
Programs
-
Mathematica
LinearRecurrence[{220, -16368, 489280, -5395456, 14745600}, {9, 252, 10944, 617472, 41457024}, 20] (* Paolo Xausa, Mar 10 2024 *)
Formula
a(n) = 9/10 * 1/(2^10) * (2 * 10^(2n) + 20 * 8^(2n) + 90 * 6^(2n) + 240 * 4^(2n) + 420 * 2^(2n)) (proved in the Quora answers).
G.f.: -9 *(1111680*x^4 -229888*x^3 +11424*x^2 -192*x +1) *x / ((100*x-1) *(4*x-1) *(36*x-1) *(64*x-1) *(16*x-1)). - Alois P. Heinz, Apr 17 2018