A376645 The maximum exponent in the factorization of n into powers of Gaussian primes.
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, 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, 1, 2, 1, 6, 1, 2, 2, 4, 1, 2, 1, 8, 4, 2, 1, 4, 1, 2, 1
Offset: 1
Examples
a(2) = 2 because 2 = -i * (1+i)^2.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Gaussian Prime.
- Wikipedia, Gaussian integer: Unique factorization.
Programs
-
Mathematica
a[n_] := Max[FactorInteger[n, GaussianIntegers -> True][[;; , 2]]]; a[1] = 0; Array[a, 100] (* or *) 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]
-
PARI
a(n) = if(n == 1, 0, vecmax(factor(n*I)[, 2]));
-
PARI
a(n) = my(e = valuation(n, 2), es = factor(n >> e)[, 2]); max(2*e, if(#es, vecmax(es), 0));
Comments