OFFSET
1,2
COMMENTS
Number of factors in the factorization of the polynomial x^n-1 over GF(5). - T. D. Noe, Apr 16 2003
REFERENCES
R. Lidl and H. Niederreiter, Finite Fields, Addison-Wesley, 1983, p. 65.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = Sum_{d|m} phi(d)/ord(5, d), where m is n with all factors of 5 removed. - T. D. Noe, Apr 19 2003
a(n) = (1/ord(5,m))*Sum_{j = 0..ord(5,m)-1} gcd(5^j - 1, m), where m is n with all factors of 5 removed. - Nihar Prakash Gargava, Nov 14 2018
EXAMPLE
a(15) = 2 because (1) the function 5x mod 15 has the two cycles (0),(5,10) and (2) the factorization of x^15-1 over integers mod 5 is (4+x)^5 (1+x+x^2)^5, which has two unique factors. Note that the length of the cycles is the same as the degree of the factors.
MATHEMATICA
Table[Length[FactorList[x^n - 1, Modulus -> 5]] - 1, {n, 100}]
CountFactors[p_, n_] := Module[{sum=0, m=n, d, f, i}, While[Mod[m, p]==0, m/=p]; d=Divisors[m]; Do[f=d[[i]]; sum+=EulerPhi[f]/MultiplicativeOrder[p, f], {i, Length[d]}]; sum]; Table[CountFactors[5, n], {n, 100}]
PROG
(PARI) a(n)={sumdiv(n/5^valuation(n, 5), d, eulerphi(d)/znorder(Mod(5, d))); }
vector(100, n, a(n)) \\ Joerg Arndt, Jan 22 2024
(Python)
from sympy import totient, n_order, divisors
def A023137(n):
a, b = divmod(n, 5)
while not b:
n = a
a, b = divmod(n, 5)
return sum(totient(d)//n_order(5, d) for d in divisors(n, generator=True) if d>1)+1 # Chai Wah Wu, Apr 09 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved