%I #8 Oct 01 2024 08:51:11
%S 0,2,1,4,1,2,1,6,2,2,1,4,1,2,1,8,1,2,1,4,1,2,1,6,2,2,3,4,1,2,1,10,1,2,
%T 1,4,1,2,1,6,1,2,1,4,2,2,1,8,2,2,1,4,1,3,1,6,1,2,1,4,1,2,2,12,1,2,1,4,
%U 1,2,1,6,1,2,2,4,1,2,1,8,4,2,1,4,1,2,1
%N The maximum exponent in the factorization of n into powers of Gaussian primes.
%C a(n) = 0 only for n = 1. a(n) = k occurs infinitely many times for k >= 1. The numbers n = 2^e * m = 2^A007814(n) * A000265(n) for which a(n) = k and their asymptotic density are as follows:
%C 1. k = 1: n is an odd squarefree number (A056911) and the density is d(1) = 2/(3*zeta(2)) = 0.405284... (A185199).
%C 2. k >= 3 is odd: e < (k+1)/2 and m is a (k+1)-free number that is not a k-free number: d(k) = (1 - 1/2^((k+1)/2)) * (f(k+1)/zeta(k+1) - f(k)/zeta(k)), where f(k) = 1 - 1/2^k.
%C 3. k >= 2 is even: e = k/2 and m is a (k+1)-free number, or e < k/2 and m is a (k+1)-free number that is not a k-free number: d(k) = (1/2^(k/2+1)) * f(k+1)/zeta(k+1) + (1-1/2^(k/2)) * (f(k+1)/zeta(k+1) - f(k)/zeta(k)), where f(k) is defined above.
%C The asymptotic mean of this sequence is Sum_{k>=1} k * d(k) = 2.64836785173193409440576... .
%H Amiram Eldar, <a href="/A376645/b376645.txt">Table of n, a(n) for n = 1..10000</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/GaussianPrime.html">Gaussian Prime</a>.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Gaussian_integer#Unique_factorization">Gaussian integer: Unique factorization</a>.
%F a(n) = max(2*A007814(n), A051903(A000265(n))) = max(2*A007814(n), A375669(n)).
%e a(2) = 2 because 2 = -i * (1+i)^2.
%t a[n_] := Max[FactorInteger[n, GaussianIntegers -> True][[;; , 2]]]; a[1] = 0; Array[a, 100]
%t (* or *)
%t a[n_] := Module[{e = IntegerExponent[n, 2], od, em}, odd = n / 2^e; Max[2*e, If[odd == 1, 0, Max[FactorInteger[odd][[;;, 2]]]]]]; Array[a, 100]
%o (PARI) a(n) = if(n == 1, 0, vecmax(factor(n*I)[, 2]));
%o (PARI) a(n) = my(e = valuation(n, 2), es = factor(n >> e)[, 2]); max(2*e, if(#es, vecmax(es), 0));
%Y Cf. A000265, A051903, A007814, A056911, A078458, A086275, A185199, A335852, A375669.
%K nonn,easy
%O 1,2
%A _Amiram Eldar_, Oct 01 2024