This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A307381 #25 Dec 05 2024 18:05:22 %S A307381 1,0,1,1,1,0,5,2,4,0,1,1,5,0,1,0,1,0,5,1,5,0,1,2,0,0,0,5,1,0,5,0,1,0, %T A307381 5,4,5,0,5,2,1,0,5,1,4,0,1,0,0,0,1,5,1,0,1,10,5,0,1,1,5,0,20,0,5,0,5, %U A307381 1,1,0,1,8,5,0,0,5,5,0,5,0,0,0,1,5,1,0,1 %N A307381 Number of sextic primitive Dirichlet characters modulo n. %C A307381 a(n) is the number of primitive Dirichlet characters modulo n such that all entries are 0 or a six-power root of unity (1, (1 + sqrt(3)*i)/2, (-1 + sqrt(3)*i)/2, -1, (-1 - sqrt(3)*i)/2, (1 - sqrt(3)*i)/2). %C A307381 Mobius transform of A319100. %H A307381 Jianing Song, <a href="/A307381/b307381.txt">Table of n, a(n) for n = 1..65539</a> %F A307381 Multiplicative with a(4) = 1, a(8) = 2, a(2^e) = 0 for e = 1 or e >= 4; a(3) = 1, a(9) = 4, a(3^e) = 0 for e >= 3; a(p) = 5 if p == 1 (mod 6) and 1 if p == 5 (mod 6), a(p^e) = 0 if p > 3 and e >= 2. %e A307381 Let w = exp(2*Pi/6) = (1 + sqrt(3)*i)/2. For n = 19, the 5 sextic primitive Dirichlet characters modulo n are: %e A307381 Chi_1 = [0, 1, w, w, w - 1, -w, w - 1, 1, -1, w - 1, -w + 1, 1, -1, -w + 1, w, -w + 1, -w, -w, -1]; %e A307381 Chi_2 = [0, 1, w - 1, w - 1, -w, w - 1, -w, 1, 1, -w, -w, 1, 1, -w, w - 1, -w, w - 1, w - 1, 1]; %e A307381 Chi_3 = [0, 1, -1, -1, 1, 1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, 1, 1, -1]; %e A307381 Chi_4 = [0, 1, -w, -w, w - 1, -w, w - 1, 1, 1, w - 1, w - 1, 1, 1, w - 1, -w, w - 1, -w, -w, 1]; %e A307381 Chi_5 = [0, 1, -w + 1, -w + 1, -w, w - 1, -w, 1, -1, -w, w, 1, -1, w, -w + 1, w, w - 1, w - 1, -1], %e A307381 so a(19) = 5. %t A307381 f[2, e_] := Which[e == 1, 0, e == 2, 1, e == 3, 2, e >= 4, 0]; f[3, e_] := Which[e == 1, 1, e == 2, 4, e >= 3, 0]; f[p_, 1] := If[Mod[p, 6] == 1, 5, 1]; f[p_, e_] := 0; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* _Amiram Eldar_, Sep 16 2020 *) %o A307381 (PARI) a(n)={ %o A307381 my(r=1, f=factor(n)); %o A307381 for(j=1, #f[, 1], my(p=f[j, 1], e=f[j, 2]); %o A307381 if(p==2, if(e==3, r*=2, if(e!=2, r=0; return(r)))); %o A307381 if(p==3, if(e==2, r*=4, if(e!=1, r=0; return(r)))); %o A307381 if(p>3, if(p%6==1&&e==1, r*=5, if(e!=1, r=0; return(r)))); %o A307381 ); %o A307381 return(r); %o A307381 } \\ _Jianing Song_, Nov 10 2019 %Y A307381 Number of k-th power primitive Dirichlet characters modulo n: A114643 (k=2), A160498 (k=3), A160499 (k=4), A307380 (k=5), this sequence (k=6), A307382 (k=7), A329272 (k=8). %Y A307381 Cf. A319100 (number of solutions to x^6 == 1 (mod n)). %K A307381 nonn,mult %O A307381 1,7 %A A307381 _Jianing Song_, Apr 06 2019