close
login
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.
0
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, 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, 2, 2, 2, 5, 2, 3, 2, 7, 5, 2, 2, 2, 3, 2, 7, 5, 2, 2, 3
OFFSET
1,2
COMMENTS
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.
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}.
EXAMPLE
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.
PROG
(Python)
from itertools import count, islice
from sympy import isprime
from sympy.solvers.diophantine.diophantine import cornacchia
def A383176_gen(): # generator of terms
yield 1
for p in count(5, 4):
if isprime(p):
for x, y in cornacchia(1, 1, p):
yield p//(x*y)
A383176_list = list(islice(A383176_gen(), 30)) # Chai Wah Wu, Apr 26 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Gonzalo Martínez, Apr 18 2025
EXTENSIONS
Definition clarified by Chai Wah Wu, Apr 26 2025
STATUS
approved