OFFSET
1,2
COMMENTS
Suggested by a discussion initiated by Keith F. Lynch on the MathFun mailing list Sept 8, 2024 about when sums and products of real numbers x,y,z are integers and later raising other similar questions.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..8450 (terms 1..2000 from Hugo Pfoertner)
MAPLE
a:=proc(n)
local x, y, z, w, N;
N:=0:
for x from 0 to n-1 do
for y from x to n-1 do
for z from y to n-1 do
if (x+y+z-x*y*z) mod n = 0 then N:=N + 1; fi;
od:
od:
od:
N;
end:
PROG
(PARI) a(n) = sum(x=0, n-1, sum(y=x, n-1, sum(z=y, n-1, Mod(x+y+z-x*y*z, n)==0))); \\ Michel Marcus, Sep 15 2024
(Python)
def A376183(n):
c = 0
for x in range(n):
for y in range(x, n):
xy, xyp = x*y%n-1, (x+y)%n
c += sum(not (xy*z-xyp)%n for z in range(y, n))
return c # Chai Wah Wu, Sep 19 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
W. Edwin Clark, Sep 14 2024
EXTENSIONS
More terms from Hugo Pfoertner, Sep 15 2024
STATUS
approved