OFFSET
3,1
COMMENTS
If there exists some prime p > 3 such that p-1 divides n, then x^n (mod p) is either 0 or 1 for all integers x, therefore giving an upper bound of a(n) <= p.
LINKS
Robin Visser, Table of n, a(n) for n = 3..5000
EXAMPLE
For n = 3, x^3 + y^3 attains all values on Z/2Z, Z/3Z, and Z/5Z, but x^3 + y^3 == 3 (mod 7) has no solution, so a(3) = 7.
For n = 4, x^4 + y^4 attains all values on Z/2Z and Z/3Z, but x^4 + y^4 == 3 (mod 5) has no solution, so a(4) = 5.
PROG
(Sage)
def a(n):
for p in Primes():
all_values = set()
for x in range(p):
for y in range(p):
all_values.add((x^n+y^n)%p)
if len(all_values) < p: return p
(PARI) a(n) = my(p=2); while (#setbinop((x, y)->Mod(x, p)^n+Mod(y, p)^n, [0..p-1]) == p, p=nextprime(p+1)); p; \\ Michel Marcus, Nov 27 2023
(Python)
from itertools import combinations_with_replacement
from sympy import sieve
def A367689(n):
for p in sieve.primerange(n**4+1):
s = set()
for k in combinations_with_replacement({pow(x, n, p) for x in range(p)}, 2):
s.add(sum(k)%p)
if len(s) == p:
break
else:
return p # Chai Wah Wu, Nov 27 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Robin Visser, Nov 26 2023
STATUS
approved