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).
A319099
Number of solutions to x^5 == 1 (mod n).
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 5, 1, 1, 1, 1, 1, 5, 1, 5, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 5, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 5, 5, 1, 1, 1, 5, 1, 1, 1, 1, 5, 1, 1, 1, 5, 1, 5, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1
Offset: 1
Solutions to x^5 == 1 (mod 11): x == 1, 3, 4, 5, 9 (mod 11).
Solutions to x^5 == 1 (mod 25): x == 1, 6, 11, 16, 21 (mod 25) (x == 1 (mod 5)).
Solutions to x^5 == 1 (mod 31): x == 1, 2, 4, 8, 16 (mod 31).
-
f[p_, e_] := If[Mod[p, 5] == 1, 5, 1]; f[5, 1] = 1; f[5, e_] := 5; 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(5,Z[i]));
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]))
A293485
The number of 8th powers in the multiplicative group modulo n.
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 5, 1, 3, 3, 1, 1, 2, 3, 9, 1, 3, 5, 11, 1, 5, 3, 9, 3, 7, 1, 15, 1, 5, 2, 3, 3, 9, 9, 3, 1, 5, 3, 21, 5, 3, 11, 23, 1, 21, 5, 2, 3, 13, 9, 5, 3, 9, 7, 29, 1, 15, 15, 9, 2, 3, 5, 33, 2, 11, 3, 35, 3, 9, 9, 5, 9, 15, 3, 39, 1, 27, 5, 41, 3, 2
Offset: 1
-
A293485 := proc(n)
local r,j;
r := {} ;
for j from 1 to n do
if igcd(j,n)= 1 then
r := r union { modp(j &^ 8,n) } ;
end if;
end do:
nops(r) ;
end proc:
seq(A293485(n),n=1..120) ;
-
a[n_] := EulerPhi[n]/Count[Range[0, n - 1]^8 - 1, k_ /; Divisible[k, n]];
Array[a, 100] (* Jean-François Alcover, May 24 2023 *)
f[p_, e_] := (p - 1)*p^(e - 1)/Switch[Mod[p, 8], 1, 8, 5, 4, , 2]; f[2, e] := If[e <= 4, 1, 2^(e - 5)]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Aug 10 2023 *)
-
\\ The following two functions by Charles R Greathouse IV, from A247257:
g(p, e) = if(p==2, 2^min(e-1, 4), if(p%4==3, 2, if(p%8==5, 4, 8)));
A247257(n) = my(f=factor(n)); prod(i=1, #f~, g(f[i, 1], f[i, 2]));
A293485(n) = (eulerphi(n)/A247257(n)); \\ Antti Karttunen, Dec 05 2017
A329272
Number of octic primitive Dirichlet characters modulo n.
Original entry on oeis.org
1, 0, 1, 1, 3, 0, 1, 2, 0, 0, 1, 1, 3, 0, 3, 4, 7, 0, 1, 3, 1, 0, 1, 2, 0, 0, 0, 1, 3, 0, 1, 8, 1, 0, 3, 0, 3, 0, 3, 6, 7, 0, 1, 1, 0, 0, 1, 4, 0, 0, 7, 3, 3, 0, 3, 2, 1, 0, 1, 3, 3, 0, 0, 0, 9, 0, 1, 7, 1, 0, 1, 0, 7, 0, 0, 1, 1, 0, 1, 12, 0, 0, 1, 1, 21, 0, 3, 2, 7, 0, 3
Offset: 1
Let w = exp(2*Pi*i/8) = sqrt(2)/2 + i*sqrt(2)/2. For n = 17, the 7 octic primitive Dirichlet characters modulo n are:
Chi_1 = [0, 1, -i, w, -1, -w, -w^3, w^3, i, i, w^3, -w^3, -w, -1, w, -i, 1];
Chi_2 = [0, 1, -1, i, 1, i, -i, -i, -1, -1, -i, -i, i, 1, i, -1, 1];
Chi_3 = [0, 1, i, w^3, -1, -w^3, -w, w, -i, -i, w, -w, -w^3, -1, w^3, i, 1];
Chi_4 = [0, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, 1, -1, 1, 1];
Chi_5 = [0, 1, -i, -w, -1, w, w^3, -w^3, i, i, -w^3, w^3, w, -1, -w, -i, 1];
Chi_6 = [0, 1, -1, -i, 1, -i, i, i, -1, -1, i, i, -i, 1, -i, -1, 1];
Chi_7 = [0, 1, i, -w^3, -1, w^3, w, -w, -i, -i, -w, w, w^3, -1, -w^3, i, 1],
so a(17) = 7.
Cf.
A247257 (number of solutions to x^8 == 1 (mod n)).
-
f[2, e_] := If[2 <= e <= 5, 2^(e-2), 0]; f[p_, e_] := If[e == 1, GCD[p-1, 8] - 1, 0]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 16 2020 *)
-
a(n)={
my(r=1, f=factor(n));
for(j=1, #f[, 1], my(p=f[j, 1], e=f[j, 2]);
if(p==2, if(e>=2&&e<=5, r*=2^(e-2), r=0; return(r)));
if(p>2, if(e==1, r*=gcd(p-1,8)-1, r=0; return(r)));
);
return(r);
}
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 is a subgroup of G.
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, 3, 1, 2, 1, 1, 1, 4, 2, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 2, 4, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 4, 1, 3, 1, 2, 1, 1, 1, 4, 1, 3, 1, 4, 1, 2, 1, 2, 1, 1, 1
Offset: 1
m/n 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 3 1 2 1 3 1 2 1 3 1 2 1 3 1 2 1 3
6 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2
7 1 2 2 2 1 4 1 2 2 2 1 4 1 2 2 2 1 4 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 2 2 1 4 1 2 2 2 1 4 1 2 2 2 1 4 1 2
10 1 2 1 3 1 2 1 3 1 2 1 3 1 2 1 3 1 2 1 3
11 1 2 1 2 2 2 1 2 1 4 1 2 1 2 2 2 1 2 1 4
12 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4
13 1 2 2 3 1 4 1 3 2 2 1 6 1 2 2 3 1 4 1 3
14 1 2 2 2 1 4 1 2 2 2 1 4 1 2 2 2 1 4 1 2
15 1 4 1 6 1 4 1 6 1 4 1 6 1 4 1 6 1 4 1 6
16 1 4 1 6 1 4 1 6 1 4 1 6 1 4 1 6 1 4 1 6
17 1 2 1 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]))
Showing 1-8 of 8 results.
Comments