OFFSET
1,3
COMMENTS
The values of n for which a(n) = n seem to be A007775, but I have no proof of this.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..30000
Charles R Greathouse IV, Program for computing terms (C with PARI)
MAPLE
a:=proc(n)
local x, y, z, N;
N:=NULL;
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) mod n = 1 mod n then N:=N, (x+y+z) mod n; fi;
od:
od:
od:
nops({N});
end:
PROG
(Python)
def A376318(n):
s = set()
for x in range(n):
for y in range(x, n):
try:
s.add((x+y+pow(x*y%n, -1, n))%n)
except:
continue
return len(s) # Chai Wah Wu, Sep 23 2024
(PARI) a(n)=my(v=vectorsmall(n)); for(x=1, n, if(gcd(x, n)>1, next); for(y=1, x, if(gcd(y, n)>1, next); my(z=1/Mod(x*y, n)); v[lift(x+y+z)+1]=1)); sum(i=1, n, v[i]) \\ Charles R Greathouse IV, Sep 23 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
W. Edwin Clark, Sep 22 2024
STATUS
approved