This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A376318 #37 Sep 30 2024 14:40:35 %S A376318 1,1,2,1,4,2,7,2,4,4,11,2,13,7,8,3,17,4,19,4,14,11,23,4,20,13,11,7,29, %T A376318 8,31,6,22,17,28,4,37,19,26,8,41,14,43,11,16,23,47,6,49,20,34,13,53, %U A376318 11,44,14,38,29,59,8,61,31,28,11,52,22,67,17,46,28,71,8,73,37,40,19,77,26 %N A376318 The number of distinct values of x+y+z (mod n) when x*y*z = 1 (mod n). %C A376318 The values of n for which a(n) = n seem to be A007775, but I have no proof of this. %H A376318 Charles R Greathouse IV, <a href="/A376318/b376318.txt">Table of n, a(n) for n = 1..30000</a> %H A376318 Charles R Greathouse IV, <a href="/A376318/a376318.c.txt">Program for computing terms (C with PARI)</a> %p A376318 a:=proc(n) %p A376318 local x,y,z,N; %p A376318 N:=NULL; %p A376318 for x from 0 to n-1 do %p A376318 for y from x to n-1 do %p A376318 for z from y to n-1 do %p A376318 if (x*y*z) mod n = 1 mod n then N:=N,(x+y+z) mod n; fi; %p A376318 od: %p A376318 od: %p A376318 od: %p A376318 nops({N}); %p A376318 end: %o A376318 (Python) %o A376318 def A376318(n): %o A376318 s = set() %o A376318 for x in range(n): %o A376318 for y in range(x,n): %o A376318 try: %o A376318 s.add((x+y+pow(x*y%n,-1,n))%n) %o A376318 except: %o A376318 continue %o A376318 return len(s) # _Chai Wah Wu_, Sep 23 2024 %o A376318 (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 %Y A376318 Cf. A007775, A376296, A376183, A180783, A376427. %K A376318 nonn %O A376318 1,3 %A A376318 _W. Edwin Clark_, Sep 22 2024