Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A115879
a(n) is the least positive x satisfying the Diophantine equation x^2=y(y+n). a(n)=0 if there are no solutions.
4
0, 0, 2, 0, 6, 4, 12, 3, 6, 12, 30, 8, 42, 24, 4, 6, 72, 12, 90, 24, 10, 60, 132, 5, 30, 84, 18, 48, 210, 8, 240, 12, 22, 144, 6, 24, 342, 180, 26, 15, 420, 20, 462, 120, 12, 264, 552, 7, 84, 60, 34, 168, 702, 36, 24, 21, 38, 420, 870, 16, 930, 480, 8, 24, 36, 44
OFFSET
1,3
EXAMPLE
a(15)=4 since the solutions (x,y) to x^2=y(y+15) are (4,1), (10,5), (18, 12) and (56, 49). The least x values is 4, from (x,y)=(4,1).
PROG
(Python)
from itertools import takewhile
from collections import deque
from sympy import divisors
def A115879(n): return -(a:=next(iter(deque((d for d in takewhile(lambda d:d<n, divisors(n**2)) if not (d-n**2//d)&3), 1)), 0))+(n**2//a if a else 0)>>2 # Chai Wah Wu, Aug 21 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Giovanni Resta, Feb 02 2006
STATUS
approved