login
Numbers k such that k! has initial digit '2'.
18

%I #28 Apr 07 2026 00:12:48

%S 2,4,16,20,23,30,32,34,39,44,47,54,58,68,75,85,86,87,113,114,115,126,

%T 135,142,148,153,159,163,168,172,180,184,188,195,205,208,211,214,217,

%U 220,223,226,234,237,242,247,252,257,262,269,276,278,287,289,302,304

%N Numbers k such that k! has initial digit '2'.

%C The asymptotic density of this sequence is log_10(3/2) = 0.176091... (see A154580) (Kunoff, 1987). - _Amiram Eldar_, Jul 17 2020

%C 10^10 and 10^1000 are both in this sequence: the first 10 digits of (10^10)! and (10^1000)! are '2325796205' and '2101826996', respectively. This can be computed from the fractional part of (log(2 Pi)/2 - N)/log(10), as follows from Stirling's approximation. - _M. F. Hasler_, Apr 03 2026

%H Chai Wah Wu, <a href="/A045521/b045521.txt">Table of n, a(n) for n = 1..10000</a>

%H Sharon Kunoff, <a href="https://www.fq.math.ca/Scanned/25-4/kunoff.pdf">N! has the first digit property</a>, The Fibonacci Quarterly, Vol. 25, No. 4 (1987), pp. 365-367.

%H <a href="/index/Fa#factorial">Index entries for sequences related to factorial numbers</a>

%F A008905(a(n)) = 2. - _Amiram Eldar_, Jul 17 2020

%e 4 is a term since 4! = 24 has the initial digit 2.

%t Select[ Range[ 310 ], IntegerDigits[ #! ] [ [ 1 ] ] == 2 & ]

%o (PARI) isok(n) = digits(n!)[1] == 2; \\ _Michel Marcus_, Feb 07 2017

%o (PARI) select( {is_A045521(n)=Vec(Str(factorial(n)))[1]=="2"}, [0..399]) \\ Maybe not suitable for very large n >> 10^10. - _M. F. Hasler_, Apr 03 2026

%Y For factorials with initial digit d (1 <= d <= 9) see A045509, A045510, A045511, A045516, A045517, A045518, A282021, A045519; A045520, A045521, A045522, A045523, A045524, A045525, A045526, A045527, A045528, A045529. See also A000142, A008905, A154580.

%K nonn,base

%O 1,1

%A _Jeff Burch_

%E Offset changed to 1 by _Chai Wah Wu_, Feb 07 2017