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.

A073095 Numbers k such that the final nonzero digit of k! is the same as the last digit of binomial(2k,k) (in base 10).

Original entry on oeis.org

5, 12, 26, 31, 35, 51, 56, 60, 136, 152, 157, 177, 182, 252, 257, 275, 280, 287, 300, 305, 312, 627, 632, 650, 655, 662, 675, 680, 687, 751, 756, 760, 786, 811, 886, 902, 907, 927, 932, 1251, 1256, 1260, 1286, 1311, 1377, 1382, 1400, 1405, 1412, 1425
Offset: 1

Views

Author

Benoit Cloitre, Aug 18 2002

Keywords

Examples

			12! = 479001600, binomial(24,12) = 2704156, and the last nonzero digit of 12! is the same as the last digit of binomial(24,12), hence 12 is in the sequence.
		

Programs

  • Mathematica
    Select[Range[1500],Mod[#!/10^IntegerExponent[#!,10],10]==Mod[Binomial[2 #,#],10]&] (* Harvey P. Dale, Sep 13 2022 *)
  • Python
    from math import comb
    from functools import reduce
    from itertools import count, zip_longest, islice
    from sympy.ntheory.factor_ import digits
    from sympy.ntheory.modular import crt
    def A073095_gen(startvalue=2): # generator of terms >= startvalue
        for n in count(max(startvalue,2)):
            s, s2 = digits(n,5)[-1:0:-1], digits(n<<1,5)[-1:0:-1]
            if reduce(lambda x,y:x*y%10,(((6,2,4,8,6,2,4,8,2,4,8,6,6,2,4,8,4,8,6,2)[(a<<2)|(i*a&3)] if i*a else (1,1,2,6,4)[a]) for i, a in enumerate(s)),6)==crt([2,5],[0,reduce(lambda x,y:x*y%5,(comb(a, b) for a, b in zip_longest(s2,s,fillvalue=0)))])[0]:
                yield n
    A073095_list = list(islice(A073095_gen(),50)) # Chai Wah Wu, Dec 07 2023

Formula

k such that A008904(k) = binomial(2k, k) reduced (mod 10).