login
Highest power of 13 dividing n!.
6

%I #19 Jun 20 2020 16:10:35

%S 0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,

%T 2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,

%U 5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,8

%N Highest power of 13 dividing n!.

%H Alois P. Heinz, <a href="/A090620/b090620.txt">Table of n, a(n) for n = 0..10000</a> (first 1001 terms from T. D. Noe)

%F a(n) = A090622(n, 13) = A090623(n, 13) = [n/13]+[n/169]+[n/2197]+...

%F a(n) = n/12 + O(log n). - _Charles R Greathouse IV_, Aug 06 2012

%p a:= proc(n) option remember; `if`(n=0, 0,

%p a(n-1)+padic[ordp](n, 13))

%p end:

%p seq(a(n), n=0..120); # _Alois P. Heinz_, Jun 20 2020

%t IntegerExponent[Range[0,110]!,13] (* _Harvey P. Dale_, Aug 22 2011 *)

%t FoldList[Plus, 0, IntegerExponent[Range[100], 13]] (* _T. D. Noe_, Apr 10 2012 *)

%o (PARI) a(n)=my(t);while(n,t+=n\=13);t \\ _Charles R Greathouse IV_, Aug 06 2012

%Y Cf. A011371, A054861.

%K nonn,easy

%O 0,27

%A _Henry Bottomley_, Dec 06 2003