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.

Original entry on oeis.org

0, 1, 11, 29, 36, 193, 281
Offset: 1

Views

Author

Zhining Yang, Jan 28 2023

Keywords

Comments

If it exists, a(8) > 100000.

Examples

			11 is a term since 11! = 39916800, and the numbers of odd and even digits are both 4.
29 is a term since 29!=8841761993739701954543616000000, and the numbers of odd and even digits are 16 and 15 respectively.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 500],
     Count[IntegerDigits[#!], _?OddQ] >=
       Count[IntegerDigits[#!], _?EvenQ] &]
  • Python
    from sympy import factorial as f
    def ok(n):
        s=str(f(n))
        return(sum(1 for k in s if k in '02468')<=sum(1 for k in s if k in '13579'))
    print([n for n in range(501) if ok(n)])
    
  • Python
    from math import factorial
    from itertools import count, islice
    def A360181_gen(startvalue=0): # generator of terms >= startvalue
        f = factorial(m:=max(startvalue,0))
        for k in count(m):
            if len(s:=str(f)) <= sum(1 for d in s if d in {'1','3','5','7','9'})<<1:
                yield k
            f *= k+1
    A360181_list = list(islice(A360181_gen(),7)) # Chai Wah Wu, May 10 2023