OFFSET
1,2
COMMENTS
a(n) is the least number of distinct values mod n attained by a polynomial p(x) such that p(x) == 0 (mod n) if and only if x == 0 (mod n).
LINKS
FORMULA
If n = p1^k1 p2^k2 ... pr^kr, then a(n) = a(p1^k1) a(p2^k2) ... a(pr^kr), where a(p^k) is 2 if k=1 and p^(k-1) if k>=2.
Dirichlet g.f.: zeta(s-1) * Product_{p prime} (1 - 1/p^(s-1) + 2/p^s - 1/p^(2*s-1)). - Amiram Eldar, Oct 01 2023
EXAMPLE
For n = 8, a(8) = a(2^3) = 2^2 = 4. Also, any polynomial p(x) that is 0 only for x == 0 (mod 8) takes at least a(8)=4 distinct values. (The polynomial p(x) = x^3 + x is an example.)
When n is a prime number, the polynomial p(x) = x^(n-1), by Fermat's little theorem, is 0 (mod n) when x == 0 (mod n), and 1 (mod n) otherwise. So it takes only two distinct values, and a(p) = 2.
a(360) = a(2^3 * 3^2 * 5) = 2^2 * 3 * 2 = 24.
MATHEMATICA
f[p_, e_] := If[e == 1, 2, p^(e - 1)]; a[n_] := Times @@ f @@@ FactorInteger[n]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Jan 23 2022 *)
PROG
(Python)
from sympy import factorint, prod
def a(n):
return prod((2 if k == 1 else p**(k-1)) for (p, k) in factorint(n).items())
(PARI) a(n) = { my(f = factor(n)); for(i = 1, #f~, if(f[i, 2] == 1, f[i, 1] = 2; , f[i, 2]--; ) ); factorback(f) } \\ David A. Corneth, Jan 22 2022
CROSSREFS
KEYWORD
nonn,easy,mult
AUTHOR
Shreevatsa R, Jan 22 2022
EXTENSIONS
Corrected and extended by David A. Corneth, Jan 22 2022
STATUS
approved