login
The maximum even exponent in the prime factorization of n!, or 0 if no such exponent exists.
2

%I #11 Aug 31 2024 18:00:00

%S 0,0,0,0,0,0,4,4,2,4,8,8,10,10,2,6,6,6,16,16,18,18,4,4,22,22,10,6,6,6,

%T 26,26,14,4,32,32,34,34,8,18,38,38,6,6,6,10,42,42,46,46,22,12,12,12,

%U 50,50,26,4,54,54,56,56,28,30,30,30,64,64,66,66,32,32,70

%N The maximum even exponent in the prime factorization of n!, or 0 if no such exponent exists.

%C The sequence of indices of record values, 0, 6, 10, 12, 18, 20, 24, 30, 34, 36, 40, ..., are the evil numbers (A001969) multiplied by 2 (A125592).

%H Amiram Eldar, <a href="/A375850/b375850.txt">Table of n, a(n) for n = 0..10000</a>

%H <a href="/index/Fa#factorial">Index entries for sequences related to factorial numbers</a>.

%F a(n) = A375033(n!).

%F max(a(n), A375849(n)) = A011371(n).

%t a[n_] := Max[0, Max[Select[FactorInteger[n!][[;; , 2]], EvenQ]]]; Array[a, 100, 0]

%o (PARI) a(n) = {my(e = select(x -> !(x % 2), factor(n!)[, 2])); if(#e == 0, 0, vecmax(e));}

%o (Python)

%o from collections import Counter

%o from sympy import factorint

%o def A375850(n): return max(filter(lambda x: x&1^1,sum((Counter(factorint(i)) for i in range(2,n+1)),start=Counter()).values()),default=0) # _Chai Wah Wu_, Aug 31 2024

%Y Cf. A000142, A001969, A011371, A125592, A375033, A375849.

%K nonn,easy

%O 0,7

%A _Amiram Eldar_, Aug 31 2024