login
The second-largest exponent in the prime factorization of n, or 0 if it does not exist.
4

%I #7 Sep 03 2024 01:17:34

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

%T 0,0,0,0,0,1,0,0,0,1,1,0,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,0,1,0,0,0,0,1,

%U 0,0,0,2,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,1,1,0,0,0,0,1,0

%N The second-largest exponent in the prime factorization of n, or 0 if it does not exist.

%C First differs from A363127 at n = 60, and from A363131 at n = 72.

%C The position of the first occurrence of k = 1, 2, ..., is A167747(k+1) = 2*6^k.

%H Amiram Eldar, <a href="/A375933/b375933.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Eu#epf">Index entries for sequences computed from exponents in factorization of n</a>.

%F a(n) = A051903(A375932(n)).

%F a(n) = 0 if and only if n is a power of a squarefree number (A072774).

%F a(n) = 1 if and only if n is in A375934.

%F a(n) <= A051903(n), with equality if and only if n = 1.

%F a(n!) = A054861(n) for n != 3.

%F Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{i >= 1} i * d(i) = 0.42745228287872473252..., where d(i) = Sum_{j >= i+1} d_2(i, j) and d_2(i, j) = Product_{p prime} (1 - 1/p^(i+1) + 1/p^j - 1/p^(j+1)) - Product_{p prime} (1 - 1/p^(i+1)) + [i > 1] * (Product_{p prime} (1 - 1/p^i) - Product_{p prime} (1 - 1/p^i + 1/p^j - 1/p^(j+1))), and [] is the Iverson bracket.

%e 12 = 2^2 * 3^1 has 2 exponents in its prime factorization: 1 and 2. 2 is the largest and 1 is the second-largest. Therefore a(12) = 1.

%t a[n_] := Module[{e = FactorInteger[n][[;; , 2]]}, Max[0, Max[Select[e, # < Max[e] &]]]]; Array[a, 100]

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

%Y Cf. A051903, A054861, A072774, A167747, A375932, A375934.

%Y Cf. A363127, A363131.

%K nonn,easy

%O 1,72

%A _Amiram Eldar_, Sep 03 2024