cp's OEIS Frontend

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.

A376202 Number of pairs 1 <= x <= y <= n-1 such that gcd(x,n) = gcd(y,n) = gcd(x+y,n) = 1 and 1/x + 1/y == 1/(x+y) mod n.

This page as a plain text file.
%I A376202 #29 Nov 07 2024 08:46:23
%S A376202 0,0,2,0,0,0,6,0,0,0,0,0,12,0,0,0,0,0,18,0,12,0,0,0,0,0,0,0,0,0,30,0,
%T A376202 0,0,0,0,36,0,24,0,0,0,42,0,0,0,0,0,42,0,0,0,0,0,0,0,36,0,0,0,60,0,0,
%U A376202 0,0,0,66,0,0,0,0,0,72,0,0,0,0,0,78,0,0,0,0,0,0,0,0,0,0,0,144,0,60,0,0,0,96,0,0,0,0,0,102,0,0
%N A376202 Number of pairs 1 <= x <= y <= n-1 such that gcd(x,n) = gcd(y,n) = gcd(x+y,n) = 1 and 1/x + 1/y == 1/(x+y) mod n.
%C A376202 In general, 1/x + 1/y = 1/(x+y) is the wrong way to add fractions!
%C A376202 See A376203 for a(2*n-1)/2 and A376755 for a(6*n+1)/6.
%C A376202 From _Robert Israel_, Nov 06 2024: (Start)
%C A376202 If a(n) = 0 then a(m) = 0 whenever m is a multiple of n.
%C A376202 It appears that the primes p for which a(p) > 0 are A007645. (End)
%H A376202 Robert Israel, <a href="/A376202/b376202.txt">Table of n, a(n) for n = 1..6000</a>
%e A376202 For n = 3 the a(3) = 2 solutions are (x,y) = (1,1) and (2,2).
%e A376202 For n = 7 the a(7) = 6 solutions are (x,y) = (1,2), (1,4), (2,4), (3,5), (3,6), (5,6).
%p A376202 a:=[];
%p A376202 for n from 1 to 140 do
%p A376202 c:=0;
%p A376202 for y from 1 to n-1 do
%p A376202 for x from 1 to y do
%p A376202 if gcd(y,n) = 1 and gcd(x,n) = 1 and gcd(x+y,n) = 1  and (1/x + 1/y - 1/(x+y)) mod n = 0 then c:=c+1; fi;
%p A376202 od: # od x
%p A376202 od: # od y
%p A376202 a:=[op(a),c];
%p A376202 od: # od n
%p A376202 a;
%o A376202 (Python)
%o A376202 from math import gcd
%o A376202 def A376202(n):
%o A376202     c = 0
%o A376202     for x in range(1,n):
%o A376202         if gcd(x,n) == 1:
%o A376202             for y in range(x,n):
%o A376202                 if gcd(y,n)==gcd(z:=x+y,n)==1 and not (w:=z**2-x*y)//gcd(w,x*y*z)%n:
%o A376202                     c += 1
%o A376202     return c # _Chai Wah Wu_, Oct 06 2024
%Y A376202 Cf. A000086, A007645, A046530, A290731, A376203, A376755, A376756, A376757.
%K A376202 nonn
%O A376202 1,3
%A A376202 _Tom Duff_ and _N. J. A. Sloane_, Oct 06 2024