A060839
Number of solutions to x^3 == 1 (mod n).
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 3, 1, 1, 1, 3, 3, 1, 3, 1, 1, 1, 1, 3, 3, 3, 1, 1, 3, 1, 1, 1, 3, 3, 3, 3, 3, 1, 1, 3, 3, 1, 3, 1, 1, 1, 3, 1, 1, 3, 1, 3, 1, 3, 3, 1, 1, 1, 3, 3, 9, 1, 3, 1, 3, 1, 1, 3, 1, 3, 3, 3, 1, 3, 3, 3, 3, 1, 3, 1, 1, 3, 1, 3, 1, 1, 1, 3, 9, 1, 3, 1, 3, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3
Offset: 1
Ahmed Fares (ahmedfares(AT)my-deja.com), May 02 2001
a(7) = 3 because the three solutions to x^3 == 1 (mod 7) are x = 1,2,4.
- T. D. Noe, Table of n, a(n) for n = 1..1000
- Steven Finch, Greg Martin and Pascal Sebah, Roots of unity and nullity modulo n, Proc. Amer. Math. Soc., Vol. 138, No. 8 (2010), pp. 2729-2743.
- Steven Finch and Pascal Sebah, Squares and Cubes Modulo n, arXiv:math/0604465 [math.NT], 2006-2016.
-
A060839 := proc(n)
local a,pf,p,r;
a := 1 ;
for pf in ifactors(n)[2] do
p := op(1,pf);
r := op(2,pf);
if p = 2 then
;
elif p =3 then
if r >= 2 then
a := a*3 ;
end if;
else
if modp(p,3) = 2 then
;
else
a := 3*a ;
end if;
end if;
end do:
a ;
end proc:
seq(A060839(n),n=1..40) ; # R. J. Mathar, Mar 02 2015
-
a[n_] := Sum[ If[ Mod[k^3-1, n] == 0, 1, 0], {k, 1, n}]; Table[ a[n], {n, 1, 105}](* Jean-François Alcover, Nov 14 2011, after PARI *)
f[p_, e_] := If[Mod[p, 3] == 1, 3, 1]; f[3, 1] = 1; f[3, e_] := 3; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Aug 10 2023 *)
-
a(n)=sum(i=1,n,if((i^3-1)%n,0,1))
-
a(n)=my(f=factor(n)); prod(i=1, #f~, if(f[i, 1]==3, 3^min(f[i, 2]-1, 1), if(f[i, 1]%3==1, 3, 1))) \\ Jianing Song, Oct 21 2022
-
from math import prod
from sympy import factorint
def A060839(n): return prod(3 for p, e in factorint(n).items() if (p!=3 or e!=1) and p%3!=2) # Chai Wah Wu, Oct 19 2022
A319100
Number of solutions to x^6 == 1 (mod n).
Original entry on oeis.org
1, 1, 2, 2, 2, 2, 6, 4, 6, 2, 2, 4, 6, 6, 4, 4, 2, 6, 6, 4, 12, 2, 2, 8, 2, 6, 6, 12, 2, 4, 6, 4, 4, 2, 12, 12, 6, 6, 12, 8, 2, 12, 6, 4, 12, 2, 2, 8, 6, 2, 4, 12, 2, 6, 4, 24, 12, 2, 2, 8, 6, 6, 36, 4, 12, 4, 6, 4, 4, 12, 2, 24, 6, 6, 4, 12, 12, 12, 6, 8, 6, 2
Offset: 1
Solutions to x^6 == 1 (mod 13): x == 1, 3, 4, 9, 10, 12 (mod 13).
Solutions to x^6 == 1 (mod 27): x == 1, 8, 10, 17, 19, 26 (mod 27) (x == 1, 8 (mod 9)).
Solutions to x^6 == 1 (mod 37): x == 1, 10, 11, 26, 27, 36 (mod 37).
A293482
The number of 5th powers in the multiplicative group modulo n.
Original entry on oeis.org
1, 1, 2, 2, 4, 2, 6, 4, 6, 4, 2, 4, 12, 6, 8, 8, 16, 6, 18, 8, 12, 2, 22, 8, 4, 12, 18, 12, 28, 8, 6, 16, 4, 16, 24, 12, 36, 18, 24, 16, 8, 12, 42, 4, 24, 22, 46, 16, 42, 4, 32, 24, 52, 18, 8, 24, 36, 28, 58, 16, 12, 6, 36, 32, 48, 4, 66, 32, 44, 24, 14, 24, 72, 36, 8, 36, 12, 24, 78, 32, 54, 8, 82, 24
Offset: 1
-
A293482 := proc(n)
local r,j;
r := {} ;
for j from 1 to n do
if igcd(j,n)= 1 then
r := r union { modp(j &^ 5,n) } ;
end if;
end do:
nops(r) ;
end proc:
seq(A293482(n),n=1..120) ;
-
a[n_] := Module[{r, j}, r = {}; For[j = 1, j <= n, j++, If[GCD[j, n] == 1, r = r ~Union~ {PowerMod[j, 5, n]}] ]; Length[r]];
Table[a[n], {n, 1, 120}] (* Jean-François Alcover, Feb 14 2023, after R. J. Mathar *)
f[p_, e_] := (p - 1)*p^(e - 1)/If[Mod[p, 5] == 1, 5, 1]; f[2, e_] := 2^(e - 1); f[2, 1] = 1; f[5, e_] := 4*5^(e-2); f[5, 1] = 4; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Aug 10 2023 *)
A319101
Number of solutions to x^7 == 1 (mod n).
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 7
Offset: 1
Solutions to x^7 == 1 (mod 29): x == 1, 7, 16, 20, 23, 24, 25 (mod 29).
Solutions to x^7 == 1 (mod 43): x == 1, 4, 11, 16, 21, 35, 41 (mod 43).
Solutions to x^7 == 1 (mod 49): x == 1, 8, 15, 22, 29, 36, 43 (mod 49) (x == 1 (mod 7)).
-
f[p_, e_] := If[Mod[p, 7] == 1, 7, 1]; f[7, 1] = 1; f[7, e_] := 7; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Aug 10 2023 *)
-
a(n)=my(Z=znstar(n)[2]); prod(i=1, #Z, gcd(7, Z[i]))
A247257
The number of octic characters modulo n.
Original entry on oeis.org
1, 1, 2, 2, 4, 2, 2, 4, 2, 4, 2, 4, 4, 2, 8, 8, 8, 2, 2, 8, 4, 2, 2, 8, 4, 4, 2, 4, 4, 8, 2, 16, 4, 8, 8, 4, 4, 2, 8, 16, 8, 4, 2, 4, 8, 2, 2, 16, 2, 4, 16, 8, 4, 2, 8, 8, 4, 4, 2, 16, 4, 2, 4, 16, 16, 4, 2, 16, 4, 8, 2, 8, 8, 4, 8, 4, 4, 8, 2, 32
Offset: 1
-
A247257 := proc(n)
local a,pf,p,r;
a := 1 ;
for pf in ifactors(n)[2] do
p := op(1,pf);
r := op(2,pf);
if p = 2 then
if r >= 5 then
a := a*16 ;
else
a := a*op(r,[1,2,4,8]) ;
end if;
elif modp(p,4) = 3 then
a := a*2;
elif modp(p,8) = 5 then
a := a*4;
elif modp(p,8) = 1 then
a := a*8;
else
error
end if;
end do:
a ;
end proc:
-
g[p_, e_] := Which[p==2, 2^Min[e-1, 4], Mod[p, 4]==3, 2, Mod[p, 8]==5, 4, True, 8];
a[1] = 1; a[n_] := Times @@ g @@@ FactorInteger[n];
Array[a, 80] (* Jean-François Alcover, Nov 26 2017, after Charles R Greathouse IV *)
-
g(p,e)=if(p==2, 2^min(e-1,4), if(p%4==3, 2, if(p%8==5, 4, 8)))
a(n)=my(f=factor(n)); prod(i=1,#f~, g(f[i,1],f[i,2])) \\ Charles R Greathouse IV, Mar 02 2015
A307380
Number of quintic primitive Dirichlet characters modulo n.
Original entry on oeis.org
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0
Offset: 1
Let w = exp(2*Pi/5). For n = 11, the 4 quintic primitive Dirichlet characters modulo n are:
Chi_1 = [0, 1, w, w^3, w^2, w^4, w^4, w^2, w^3, w, 1];
Chi_2 = [0, 1, w^2, w, w^4, w^3, w^3, w^4, w, w^2, 1];
Chi_3 = [0, 1, w^3, w^4, w, w^2, w^2, w, w^4, w^3, 1];
Chi_4 = [0, 1, w^4, w^2, w^3, w, w, w^3, w^2, w^4, 1],
so a(11) = 4.
Cf.
A319099 (number of solutions to x^5 == 1 (mod n)).
-
f[5, 2] = 4; f[p_, e_] := If[Mod[p, 5] == 1 && e == 1, 4, 0]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 16 2020 *)
-
a(n)=sum(d=1, n, if(n%d==0, moebius(n/d)*sum(i=1, d, if((i^5-1)%d, 0, 1)), 0))
-
A307380(n) = sumdiv(n, d, moebius(n/d)*sum(i=1, d, if((i^5-1)%d, 0, 1))); \\ (Slightly speeding the program above) - Antti Karttunen, Aug 22 2019
-
A307380(n) = { my(f=factor(n)); prod(i=1, #f~, if(((5==f[i,1])&&(2==f[i,2]))||((1==(f[i,1]%5))&&(1==f[i,2])),4,0)); }; \\ (After the multiplicative formula, much faster) - Antti Karttunen, Aug 22 2019
A354057
Square array read by ascending antidiagonals: T(n,k) is the number of solutions to x^k == 1 (mod n).
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 4, 1, 2, 1, 1, 1, 4, 3, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 3, 4, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 6, 1, 4, 1, 2, 1, 1, 1, 4, 1, 4, 1, 4, 1, 2, 1, 2, 1, 1, 1
Offset: 1
n/k 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
3 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2
4 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2
5 1 2 1 4 1 2 1 4 1 2 1 4 1 2 1 4 1 2 1 4
6 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2
7 1 2 3 2 1 6 1 2 3 2 1 6 1 2 3 2 1 6 1 2
8 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4
9 1 2 3 2 1 6 1 2 3 2 1 6 1 2 3 2 1 6 1 2
10 1 2 1 4 1 2 1 4 1 2 1 4 1 2 1 4 1 2 1 4
11 1 2 1 2 5 2 1 2 1 10 1 2 1 2 5 2 1 2 1 10
12 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4
13 1 2 3 4 1 6 1 4 3 2 1 12 1 2 3 4 1 6 1 4
14 1 2 3 2 1 6 1 2 3 2 1 6 1 2 3 2 1 6 1 2
15 1 4 1 8 1 4 1 8 1 4 1 8 1 4 1 8 1 4 1 8
16 1 4 1 8 1 4 1 8 1 4 1 8 1 4 1 8 1 4 1 8
17 1 2 1 4 1 2 1 8 1 2 1 4 1 2 1 16 1 2 1 4
18 1 2 3 2 1 6 1 2 3 2 1 6 1 2 3 2 1 6 1 2
19 1 2 3 2 1 6 1 2 9 2 1 6 1 2 3 2 1 18 1 2
20 1 4 1 8 1 4 1 8 1 4 1 8 1 4 1 8 1 4 1 8
Applying Moebius transform to the rows gives
A354059.
Applying Moebius transform to the columns gives
A354058.
-
T(n,k)=my(Z=znstar(n)[2]); prod(i=1, #Z, gcd(k, Z[i]))
A327924
Square array read by ascending antidiagonals: T(m,n) is the number of non-isomorphic groups G such that G is the semidirect product of C_m and C_n, where C_m is a normal subgroup of G and C_n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3 1 2 1 4 1 2 1 3 1 2 1 5 1 2 1 3
18 1 2 2 2 1 4 1 2 2 2 1 4 1 2 2 2 1 4 1 2
19 1 2 2 2 1 4 1 2 3 2 1 4 1 2 2 2 1 6 1 2
20 1 4 1 6 1 4 1 6 1 4 1 6 1 4 1 6 1 4 1 6
Example shows that T(16,4) = 6: The semidirect product of C_16 and C_4 has group representation G = <x, y|x^16 = y^4 = 1, yxy^(-1) = x^r>, where r = 1, 3, 5, 7, 9, 11, 13, 15. Since 3^3 == 11 (mod 16), 5^3 == 13 (mod 16), <x, y|x^16 = y^4 = 1, yxy^(-1) = x^3> and <x, y|x^16 = y^4 = 1, yxy^(-1) = x^11> are isomorphic, <x, y|x^16 = y^4 = 1, yxy^(-1) = x^5> and <x, y|x^16 = y^4 = 1, yxy^(-1) = x^13> are isomorphic, giving a total of 6 non-isomorphic groups.
-
numord(n,q) = my(v=divisors(q),r=znstar(n)[2]); sum(i=1,#v,prod(j=1,#r,gcd(v[i],r[j]))*moebius(q/v[i]))
T(m,n) = my(u=divisors(n)); sum(i=1,#u,numord(m,u[i])/eulerphi(u[i]))
A327925
Irregular table read by rows: T(m,n) is the number of non-isomorphic groups G such that G is the semidirect product of C_m and C_n, where C_m is a normal subgroup of G and C_n is a subgroup of G, 1 <= n <= A002322(m).
Original entry on oeis.org
1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 2, 2, 1, 4, 1, 4, 1, 2, 2, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 2, 2, 2, 1, 2, 1, 4, 1, 4, 1, 2, 2, 3, 1, 4, 1, 3, 2, 2, 1, 6, 1, 2, 2, 2, 1, 4, 1, 4, 1, 6, 1, 4, 1, 6, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 2, 2, 1, 4, 1, 2, 2, 2, 1, 4, 1, 2, 3, 2, 1, 4, 1, 2, 2, 2, 1, 6
Offset: 1
Table starts
m = 1: 1;
m = 2: 1;
m = 3: 1, 2;
m = 4: 1, 2;
m = 5: 1, 2, 1, 3;
m = 6: 1, 2;
m = 7: 1, 2, 2, 2, 1, 4;
m = 8: 1, 4;
m = 9: 1, 2, 2, 2, 1, 4;
m = 10: 1, 2, 1, 3;
m = 11: 1, 2, 1, 2, 2, 2, 1, 2, 1, 4;
m = 12: 1, 4;
m = 13: 1, 2, 2, 3, 1, 4, 1, 3, 2, 2, 1, 6;
m = 14: 1, 2, 2, 2, 1, 4;
m = 15: 1, 4, 1, 6;
m = 16: 1, 4, 1, 6;
m = 17: 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 5;
m = 18: 1, 2, 2, 2, 1, 4;
m = 19: 1, 2, 2, 2, 1, 4, 1, 2, 3, 2, 1, 4, 1, 2, 2, 2, 1, 6;
m = 20: 1, 4, 1, 6;
Example shows that T(21,6) = 6: The semidirect product of C_21 and C_6 has group representation G = <x, y|x^21 = y^6 = 1, yxy^(-1) = x^r>, where r = 1, 2, 4, 5, 8, 10, 11, 13, 16, 17, 19, 20. Since 2^5 == 11 (mod 21), 4^5 == 16 (mod 21), 5^5 == 17 (mod 21), 10^5 == 19 (mod 21), there are actually four pairs of isomorphic groups, giving a total of 8 non-isomorphic groups.
-
numord(n,q) = my(v=divisors(q),r=znstar(n)[2]); sum(i=1,#v,prod(j=1,#r,gcd(v[i],r[j]))*moebius(q/v[i]))
T(m,n) = my(u=divisors(n)); sum(i=1,#u,numord(m,u[i])/eulerphi(u[i]))
Row(m) = my(l=if(m>2,znstar(m)[2][1],1), R=vector(l,n,T(m,n))); R
Showing 1-9 of 9 results.
Comments