%I #21 May 20 2024 02:29:14
%S 1,2,3,2,1,6,1,2,9,2,1,6,1,2,3,2,1,18,1,2,3,2,1,6,1,2,27,2,1,6,1,2,3,
%T 2,1,18,1,2,3,2,1,6,1,2,9,2,1,6,1,2,3,2,1,54,1,2,3,2,1,6,1,2,9,2,1,6,
%U 1,2,3,2,1,18,1,2,3,2,1,6,1,2,81,2,1,6,1,2,3,2,1,18
%N Size of the group Z_3*/(Z_3*)^n, where Z_3 is the ring of 3-adic integers.
%C We have that Z_3*/(Z_3*)^n is the inverse limit of (Z/3^iZ)*/((Z/3^iZ)*)^n as i tends to infinity. Write n = 3^e * n' with n' not being divisible by 3, then the group is cyclic of order 3^e * gcd(2,n'). See A370050.
%H Jianing Song, <a href="/A370180/b370180.txt">Table of n, a(n) for n = 1..10000</a>
%F Multiplicative with a(3^e) = 3^e, a(2^e) = 2 and a(p^e) = 1 for primes p != 2, 3.
%F From _Amiram Eldar_, May 20 2024: (Start)
%F Dirichlet g.f.: (1 + 1/2^s) * ((1 - 1/3^s)/(1 - 1/3^(s-1))) * zeta(s).
%F Sum_{k=1..n} a(k) ~ (n/log(3)) * (log(n) + gamma - 1 + log(3) - log(2)/3), where gamma is Euler's constant (A001620). (End)
%e We have Z_3*/(Z_3*)^3 = Z_3* / ((1+9Z_3) U (8+9Z_3)) = (Z/9Z)*/((1+9Z) U (8+9Z)) = C_3, so a(3) = 3.
%e We have Z_3*/(Z_3*)^6 = Z_3* / (1+9Z_3) = (Z/9Z)*/(1+9Z) = C_6, so a(6) = 6.
%t a[n_] := Module[{e2 = IntegerExponent[n, 2], e3 = IntegerExponent[n, 3]}, 2^If[e2 == 0, 0, 1] * 3^e3]; Array[a, 100] (* _Amiram Eldar_, May 20 2024 *)
%o (PARI) a(n,{p=3}) = my(e = valuation(n, p)); p^e*gcd(p-1, n/p^e)
%Y Row 2 of A370050. Cf. A001620, A297402, A370181, A370182.
%Y Cf. A370565.
%K nonn,easy,mult
%O 1,2
%A _Jianing Song_, Apr 30 2024