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.
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
Examples
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).
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
f:= proc(n) local q; q:= max(select(t -> t^2 < n^2 and n^2/t - t mod 4 = 0, numtheory:-divisors(n^2))); if q = -infinity then 0 else (n^2/q - q)/4 fi; end proc: map(f, [$1..100]); # Robert Israel, Aug 21 2025
-
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
>2 # Chai Wah Wu, Aug 21 2024