login
Number of pandigital numbers with n places.
2

%I #19 Aug 07 2023 07:59:05

%S 0,0,0,0,0,0,0,0,0,3265920,179625600,5568393600,128432304000,

%T 2458427811840,41355201888000,632788296940800,9008498667168000,

%U 121205358007493760,1558813928579107200,19326359087766057600,232491479092720848000,2727512837264447527680,31331281164921975283200,353549170783043484480000

%N Number of pandigital numbers with n places.

%C The number of numbers between 10^(n-1) and 10^n which contain all decimal digits 0..9.

%C The ratio a(n)/(10^n-10^(n-1)) indicates the relative proportion of pandigital n-digit numbers compared to all n-digit numbers. Since that ratio converges to the limit 1 for n->oo this can be expressed for large numbers as follows (in a slightly popular manner): "Almost all numbers contain all decimal digits 0..9".

%C Example: a(n)/(10^n-10^(n-1)) = 0.99973439517775... for n = 100; in this case 99.9734...% of all 100-digit numbers contain all digits 0..9. Conversely, only the tiny proportion of 0.00026560482224... (< 0.03%) lacks one digit. That's astonishing! Intuitively, this is not what one would expect. In fact, for smaller numbers (with which most people are faced normally) the relative portion of numbers which missing at least one digit is significantly larger. Of course, for n < 10 the portion is 100%, and even for numbers with n = 10 or 20 digits the relative proportion of numbers which do not contain all digits 0..9 is 99.96371...% or 78.52626...%, respectively. The least number of digits for which the pandigital numbers hold the majority is 27. Here, the proportion of numbers which do not contain all digits is 48.03664...%. So one could bet that a randomly chosen number with >= 27 digits contains all digits.

%H Hieronymus Fischer, <a href="/A217110/b217110.txt">Table of n, a(n) for n = 1..200</a>

%F a(n) = 9*9!*S2(n,10), where the S2(n,10) are the Stirling numbers of the second kind (cf. triangle A008277).

%F Asymptotic behavior: Limit_{n->oo} a(n)/10^n = 9/10.

%F G.f.: g(x) = 9*9!*x^10/(Product_{j=1..10} (1-jx)).

%F E.g.f. g(x) = (9/10) * (e^x - 1)^10.

%e a(k) = 0 for k < 10 since there are no pandigital numbers with < 10 places, trivially.

%e a(10) = 9*9! since the first digit can be in the range 1..9 and for the following 9 digits there are 9, 8, 7, ..., 1 possible values.

%Y Cf. A171102, A050278, A011540, A002542, A053283, A217094.

%K nonn,base

%O 1,10

%A _Hieronymus Fischer_, Feb 13 2013