A367688
Number of primes p such that x^n + y^n mod p does not take all values on Z/pZ.
Original entry on oeis.org
0, 0, 1, 4, 4, 13, 5, 14, 11, 24, 9, 42, 14, 30, 26, 37, 17, 54, 17, 63, 33, 43, 25, 104, 31, 53, 49, 87, 26, 130, 27, 85, 56, 69, 56, 170, 36, 74, 68, 140, 40, 175, 43, 124, 105, 91, 45, 215, 55, 149, 87, 142, 48, 209, 83, 185, 96, 119, 57, 339, 59, 128, 133
Offset: 1
For n = 1, the equation x + y == k (mod p) always has a solution for any integer k and prime p, so a(1) = 0.
For n = 2, the equation x^2 + y^2 == k (mod p) always has a solution for any integer k and prime p, so a(2) = 0.
For n = 3, the equation x^3 + y^3 == 3 (mod 7) does not have a solution, but x^3 + y^3 == k (mod p) does have a solution for any integer k and prime p not equal to 7, thus a(3) = 1.
-
from itertools import combinations_with_replacement
from sympy import sieve
def A367688(n):
c = 0
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:
c += 1
return c # Chai Wah Wu, Nov 27 2023
-
def a(n):
ans = 0
for p in prime_range(1, n^4):
nth_powers = set([power_mod(x,n,p) for x in range(p)])
for k in range(p):
for xn in nth_powers:
if (k-xn)%p in nth_powers: break
else: ans += 1; break
return ans
-
# This is very slow for n larger than 7
def a(n):
ans = 0
for p in prime_range(1,n^4):
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: ans += 1
return ans
A368055
Smallest prime number p such that x^n + y^n + z^n mod p does not take all values on Z/pZ.
Original entry on oeis.org
5, 11, 7, 29, 5, 19, 11, 23, 5, 53, 29, 11, 5, 103, 7, 191, 5, 29, 23, 47, 5, 11, 53, 19, 5, 59, 7, 311, 5, 23, 103, 11, 5, 149, 191, 53, 5, 83, 7, 173, 5, 11, 47, 283, 5, 29, 11, 103, 5, 107, 7, 11, 5, 191, 59, 709, 5, 367, 311, 19, 5, 11, 7, 269, 5, 47, 11, 569, 5, 293, 149, 11
Offset: 4
For n = 4, x^4 + y^4 + z^4 attains all values on Z/2Z and Z/3Z, but x^4 + y^4 + z^4 == 4 (mod 5) has no solution, so a(4) = 5.
For n = 5, x^5 + y^5 + z^5 attains all values on Z/2Z, Z/3Z, Z/5Z, and Z/7Z, but x^5 + y^5 + z^5 == 4 (mod 11) has no solution, so a(5) = 11.
-
f:= proc(n) local p,s,t,T,S,S2,S3;
p:= 2;
do
p:= nextprime(p);
T:= {$0..p-1}:
S:= {seq(s^n mod p,s=0..p-1)};
if S = T then next fi;
S2:= {seq(seq(s+t mod p, s=S),t=S)};
if S2 = T then next fi;
S3:= {seq(seq(s+t mod p, s=S),t=S2)}:
if S3 <> T then return p fi
od
end proc:
map(f, [$4..100]); # Robert Israel, Jan 26 2024
-
from itertools import combinations_with_replacement
from sympy import nextprime
def A368055(n):
p = 1
while (p:=nextprime(p)):
pset = set(q:=tuple(pow(x,n,p) for x in range(p)))
if not all(any((k-a[0]-a[1])%p in pset for a in combinations_with_replacement(q,2)) for k in range(p)):
return p # Chai Wah Wu, Apr 04 2024
-
def a(n):
for p in Primes():
all_values = set()
for x in range(p):
for y in range(p):
for z in range(p): all_values.add((x^n+y^n+z^n)%p)
if len(all_values) < p: return p
A368197
Triangle read by rows: T(n,k) = Sum_{z=1..n} Sum_{y=1..n} Sum_{x=1..n} [GCD(f(x,y,z), n) = k], where f(x,y,z) = x^2 + y^2 - z^2.
Original entry on oeis.org
1, 4, 4, 18, 0, 9, 32, 8, 0, 24, 100, 0, 0, 0, 25, 72, 72, 36, 0, 0, 36, 294, 0, 0, 0, 0, 0, 49, 256, 64, 0, 96, 0, 0, 0, 96, 486, 0, 144, 0, 0, 0, 0, 0, 99, 400, 400, 0, 0, 100, 0, 0, 0, 0, 100, 1210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121
Offset: 1
Triangle begins:
1;
4, 4;
18, 0, 9;
32, 8, 0, 24;
100, 0, 0, 0, 25;
72, 72, 36, 0, 0, 36;
294, 0, 0, 0, 0, 0, 49;
256, 64, 0, 96, 0, 0, 0, 96;
486, 0, 144, 0, 0, 0, 0, 0, 99;
400, 400, 0, 0, 100, 0, 0, 0, 0, 100;
1210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121;
...
-
nn = 11; p = 2; f = x^p + y^p - z^p; Flatten[Table[Table[Sum[Sum[Sum[If[GCD[f, n] == k, 1, 0], {x, 1, n}], {y, 1, n}], {z, 1, n}], {k, 1, n}], {n, 1, nn}]]
Showing 1-3 of 3 results.
Comments