login
A247257
The number of octic characters modulo n.
9
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,3
COMMENTS
Number of solutions to x^8 == 1 (mod n). - Jianing Song, Nov 10 2019
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
S. Finch, Quartic and octic characters modulo n, arXiv:0907.4894 [math.NT], 2009.
FORMULA
Multiplicative with a(p^e) = p^min(e-1, 4) if p = 2, gcd(8, p-1) if p > 2. - Jianing Song, Nov 10 2019
MAPLE
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:
MATHEMATICA
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 *)
PROG
(PARI) 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
CROSSREFS
Number of solutions to x^k == 1 (mod n): A060594 (k=2), A060839 (k=3), A073103 (k=4), A319099 (k=5), A319100 (k=6), A319101 (k=7), this sequence (k=8).
Sequence in context: A278266 A088200 A073103 * A069177 A077659 A367953
KEYWORD
mult,nonn,easy
AUTHOR
R. J. Mathar, Mar 02 2015
STATUS
approved