login
Numbers k such that the number of odd digits in k! is greater than or equal to the number of even digits.
0

%I #36 May 13 2023 13:33:52

%S 0,1,11,29,36,193,281

%N Numbers k such that the number of odd digits in k! is greater than or equal to the number of even digits.

%C If it exists, a(8) > 100000.

%e 11 is a term since 11! = 39916800, and the numbers of odd and even digits are both 4.

%e 29 is a term since 29!=8841761993739701954543616000000, and the numbers of odd and even digits are 16 and 15 respectively.

%t Select[Range[0, 500],

%t Count[IntegerDigits[#!], _?OddQ] >=

%t Count[IntegerDigits[#!], _?EvenQ] &]

%o (Python)

%o from sympy import factorial as f

%o def ok(n):

%o s=str(f(n))

%o return(sum(1 for k in s if k in '02468')<=sum(1 for k in s if k in '13579'))

%o print([n for n in range(501) if ok(n)])

%o (Python)

%o from math import factorial

%o from itertools import count, islice

%o def A360181_gen(startvalue=0): # generator of terms >= startvalue

%o f = factorial(m:=max(startvalue,0))

%o for k in count(m):

%o if len(s:=str(f)) <= sum(1 for d in s if d in {'1','3','5','7','9'})<<1:

%o yield k

%o f *= k+1

%o A360181_list = list(islice(A360181_gen(),7)) # _Chai Wah Wu_, May 10 2023

%Y Cf. A034886, A352547, A360182.

%K nonn,base,more,less

%O 1,3

%A _Zhining Yang_, Jan 28 2023