%I #18 Jan 26 2024 11:28:54
%S 1,2,7,9,13,14,18,19,26,27,31,37,38,43,49,54,61,62,63,67,73,74,79,81,
%T 86,91,97,98,103,109,117,122,126,127,133,134,139,146,151,157,158,162,
%U 163,169,171,181,182,189,193,194,199,206,211,217,218,223,229,234,241
%N Numbers k such that A319100(k) is a power of 6.
%C Numbers k such that the number of solutions to x^6 == 1 (mod k) is a power of 6.
%C Also numbers k such that (Z/kZ)* has the same 2-rank and 3-rank, where (Z/kZ)* is the multiplicative group of integers modulo k, and the p-rank of a finite abelian group G is equal to log_p(#{x belongs to G : x^p = 1}) with p being a prime number.
%C k is a term in this sequence iff v(2, k) = 0 or 1, v(3, k) = 0 or >= 2 and k is not divisible by any prime p == 5 (mod 6). Here v(p, k) is the p-adic valuation of k.
%C Sequence contains all primes p == 1 (mod 6) and their powers and all powers of 3 except for 3 itself.
%C Decompose the multiplicative group of integers modulo k as a product of cyclic groups C_{s_1} x C_{s_2} x ... x C_{s_m}, where s_i divides s_j for i < j, then k is a term iff s_1 is divisible by 6. For k = 1 or 2, (Z/kZ)* is the trivial group, s_1 does not exist so 1 and 2 are also terms.
%C If gcd(k_1, k_2) = 1 and both k_1 and k_2 are in this sequence, so is k_1*k_2. For example, 7 and 9 are both here so 7*9 = 63 is also here. Indeed, the number of solutions to x^6 == 1 (mod 7), x^6 == 1 (mod 9) and x^6 == 1 (mod 36) are 6, 6 and 36, respectively.
%C This is an analog of A008784, since k is a term there iff s_1 (defined as above) is divisible by 4 instead of 6. But on the other hand, if k is in A008784, so are all its divisors, while this is not true for this sequence. However, if k is here and k is not divisible by 9, then all its divisors are also here.
%C This is a also an analog of A192453 (s_1 divisible by 8).
%H Jianing Song, <a href="/A319838/b319838.txt">Table of n, a(n) for n = 1..15917</a> (all terms below 100000)
%e 91 = 7*13 is a term since the number of solutions to x^6 == 1 (mod 91) is 36 = 6^2.
%e 1197 = 7*9*19 is a term since the number of solutions to x^6 == 1 (mod 1197) is 216 = 6^3.
%o (PARI) isA319838(n) = if(abs(n)==1||abs(n)==2, 1, my(i=znstar(n)[2]); !(i[#i]%6)==1, 1)
%Y Cf. A008784, A192453, A319100.
%K nonn
%O 1,2
%A _Jianing Song_, Sep 28 2018