A289460 Number of units u in Z/nZ such that Phi(3,u) is a unit, where Phi is the cyclotomic polynomial.
1, 1, 1, 2, 4, 1, 4, 4, 3, 4, 10, 2, 10, 4, 4, 8, 16, 3, 16, 8, 4, 10, 22, 4, 20, 10, 9, 8, 28, 4, 28, 16, 10, 16, 16, 6, 34, 16, 10, 16, 40, 4, 40, 20, 12, 22, 46, 8, 28, 20, 16, 20, 52, 9, 40, 16, 16, 28, 58, 8, 58, 28, 12, 32, 40, 10, 64, 32, 22, 16, 70, 12
Offset: 1
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000 (terms to 1000 from Jordan Lenchitz)
Crossrefs
Cf. A058026.
Programs
-
Maple
m:=3; T:=[]: for n from 2 to 1000 do S:={}: for a from 0 to n-1 do if gcd(a,n)=1 and gcd(cyclotomic(m,a),n)=1 then S:={op(S),a}: fi: od: T:=[op(T),nops(S)]: od: print(m,T):
-
Mathematica
Table[Count[Map[Cyclotomic[3, #] &, Select[Range@ n, CoprimeQ[#, n] &]], u_ /; CoprimeQ[u, n]], {n, 72}] (* Michael De Vlieger, Jul 11 2017 *)
-
PARI
g(n)=sum(k=0,n-1, gcd(k,n)==1 && gcd(polcyclo(3,k),n)==1) a(n)=my(f=factor(n)); prod(i=1,#f~, g(f[i,1]^f[i,2])) \\ Charles R Greathouse IV, Jul 06 2017
Comments