login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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). 3

%I #18 Dec 08 2023 08:02:10

%S 5,12,26,31,35,51,56,60,136,152,157,177,182,252,257,275,280,287,300,

%T 305,312,627,632,650,655,662,675,680,687,751,756,760,786,811,886,902,

%U 907,927,932,1251,1256,1260,1286,1311,1377,1382,1400,1405,1412,1425

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

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

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

%e 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.

%t Select[Range[1500],Mod[#!/10^IntegerExponent[#!,10],10]==Mod[Binomial[2 #,#],10]&] (* _Harvey P. Dale_, Sep 13 2022 *)

%o (Python)

%o from math import comb

%o from functools import reduce

%o from itertools import count, zip_longest, islice

%o from sympy.ntheory.factor_ import digits

%o from sympy.ntheory.modular import crt

%o def A073095_gen(startvalue=2): # generator of terms >= startvalue

%o for n in count(max(startvalue,2)):

%o s, s2 = digits(n,5)[-1:0:-1], digits(n<<1,5)[-1:0:-1]

%o 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]:

%o yield n

%o A073095_list = list(islice(A073095_gen(),50)) # _Chai Wah Wu_, Dec 07 2023

%K base,easy,nonn

%O 1,1

%A _Benoit Cloitre_, Aug 18 2002

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 23:26 EDT 2024. Contains 371917 sequences. (Running on oeis4.)