login
A376691
The number of solutions to x + y == x^2 + y^2 == x^3 + y^3 (mod n) with 0 <= x <= y < n.
1
1, 3, 3, 5, 3, 10, 3, 7, 5, 10, 3, 16, 3, 10, 10, 7, 3, 18, 3, 16, 10, 10, 3, 24, 7, 10, 5, 16, 3, 36, 3, 11, 10, 10, 10, 28, 3, 10, 10, 24, 3, 36, 3, 16, 18, 10, 3, 24, 9, 26, 10, 16, 3, 18, 10, 24, 10, 10, 3, 56, 3, 10, 18, 11, 10, 36, 3, 16, 10, 36
OFFSET
1,2
COMMENTS
This is the same as the number of solutions to x + y == x^2 + y^2 == x^3+y^3 == x^4 + y^4 (mod n) with x <=y. Proved by Sahaj in Math StackExchange link.
MAPLE
a:=proc(n)
local x, y, count;
count:=0:
for x from 0 to n-1 do
for y from x to n-1 do
if (x+y) mod n =(x^2+y^2) mod n and (x+y) mod n =(x^3+y^3) mod n then count:=count+1; fi;
od:
od:
count;
end:
PROG
(Python)
def A376691(n):
c = 0
for x in range(n):
m = x*(1-x)%n
c += sum(1 for y in range(x, n) if y*(y-1)%n == m and not m*(x-y)%n)
return c # Chai Wah Wu, Oct 02 2024
CROSSREFS
Cf. A376646.
Sequence in context: A248955 A071053 A298398 * A094439 A122037 A363796
KEYWORD
nonn
AUTHOR
W. Edwin Clark, Oct 01 2024
STATUS
approved