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.

A383176 If p = A002313(n) is a prime such that p = x^2 + y^2, then a(n) is the largest integer k that satisfies x^2 + y^2 - k*x*y > 0.

This page as a plain text file.
%I A383176 #19 Apr 27 2025 01:12:35
%S A383176 1,2,2,4,2,6,2,3,2,3,2,2,10,3,2,3,2,2,6,2,2,14,7,2,4,16,2,2,3,8,2,2,2,
%T A383176 3,2,2,2,3,20,6,2,2,3,5,2,4,2,2,2,2,24,3,5,2,2,6,2,4,2,26,5,2,13,3,2,
%U A383176 2,2,2,5,2,3,2,7,5,2,2,2,3,2,7,5,2,2,3
%N A383176 If p = A002313(n) is a prime such that p = x^2 + y^2, then a(n) is the largest integer k that satisfies x^2 + y^2 - k*x*y > 0.
%C A383176 Fermat's Christmas theorem states that if p = 2 or if p is congruent to 1 modulo 4 (A002313), then p is written as a sum of 2 squares uniquely. Thus, if A002313(n) = x^2 + y^2, for certain integers x and y, then a(n) is the largest integer k such that x^2 + y^2 - k*x*y > 0.
%C A383176 a(n) >= 2, for n > 1. If p > 2 and p = x^2 + y^2, since x != y, then it is satisfied that 0 < (x - y)^2 = x^2 + y^2 - 2x*y < x^2 + y^2 - x*y. The equality a(n) = 2 is given when |x - y| < phi*min{x, y}.
%e A383176 Since A002313(8) = 53 and 53 = 2^2 + 7^2, we have that 53 - 3*2*7 > 0 and 53 - 4*2*7 < 0, then a(8) = 3.
%o A383176 (Python)
%o A383176 from itertools import count, islice
%o A383176 from sympy import isprime
%o A383176 from sympy.solvers.diophantine.diophantine import cornacchia
%o A383176 def A383176_gen(): # generator of terms
%o A383176     yield 1
%o A383176     for p in count(5,4):
%o A383176         if isprime(p):
%o A383176             for x,y in cornacchia(1,1,p):
%o A383176                 yield p//(x*y)
%o A383176 A383176_list = list(islice(A383176_gen(),30)) # _Chai Wah Wu_, Apr 26 2025
%Y A383176 Cf. A002313, A002330, A002331.
%K A383176 nonn
%O A383176 1,2
%A A383176 _Gonzalo Martínez_, Apr 18 2025
%E A383176 Definition clarified by _Chai Wah Wu_, Apr 26 2025