cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A360181 #36 May 13 2023 13:33:52
%S A360181 0,1,11,29,36,193,281
%N A360181 Numbers k such that the number of odd digits in k! is greater than or equal to the number of even digits.
%C A360181 If it exists, a(8) > 100000.
%e A360181 11 is a term since 11! = 39916800, and the numbers of odd and even digits are both 4.
%e A360181 29 is a term since 29!=8841761993739701954543616000000, and the numbers of odd and even digits are 16 and 15 respectively.
%t A360181 Select[Range[0, 500],
%t A360181  Count[IntegerDigits[#!], _?OddQ] >=
%t A360181    Count[IntegerDigits[#!], _?EvenQ] &]
%o A360181 (Python)
%o A360181 from sympy import factorial as f
%o A360181 def ok(n):
%o A360181     s=str(f(n))
%o A360181     return(sum(1 for k in s if k in '02468')<=sum(1 for k in s if k in '13579'))
%o A360181 print([n for n in range(501) if ok(n)])
%o A360181 (Python)
%o A360181 from math import factorial
%o A360181 from itertools import count, islice
%o A360181 def A360181_gen(startvalue=0): # generator of terms >= startvalue
%o A360181     f = factorial(m:=max(startvalue,0))
%o A360181     for k in count(m):
%o A360181         if len(s:=str(f)) <= sum(1 for d in s if d in {'1','3','5','7','9'})<<1:
%o A360181             yield k
%o A360181         f *= k+1
%o A360181 A360181_list = list(islice(A360181_gen(),7)) # _Chai Wah Wu_, May 10 2023
%Y A360181 Cf. A034886, A352547, A360182.
%K A360181 nonn,base,more,less
%O A360181 1,3
%A A360181 _Zhining Yang_, Jan 28 2023