OFFSET
1,5
COMMENTS
The corresponding least y is given by A067721(n).
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
FORMULA
Empirical g.f.: -x^3*(x^9+x^8+2*x^7+4*x^6+x^5+6*x^4+2*x^3+4*x^2+1) / ((x-1)^3*(x+1)^3*(x^2+1)^3). - Colin Barker, Jun 26 2014
From empirical g.f.: a(n) = 1/2 - n/2 + 11*n^2/64 + (1/4 - 1/32*n^2) * (2*floor(n/4) + 2*floor((n+1)/4) - n + 1) + (1/4 - 5/64*n^2)*(-1)^n. - Vaclav Kotesovec, Jun 26 2014
From Chai Wah Wu, Aug 21 2024: (Start)
a(4*j) = j^2 - 2*j + 1,
a(4*j+1) = 4*j^2,
a(4*j+2) = 2*j^2,
a(4*j+3) = 4*j^2+4*j+1 (see A115880).
(End)
EXAMPLE
a(15)=49, since the solutions (x,y) to x^2=y(y+15) are (4,1), (10,5), (18, 12) and (56, 49). The largest y is 49, from (x,y)=(56,49).
MATHEMATICA
Table[Max[y/.Solve[{x^2==y*(y+n), y>0}, {x, y}, Integers]], {n, 1, 100}]/.y->0 (* Vaclav Kotesovec, Jun 26 2014 *)
PROG
(Python)
def A115881(n):
a, b = divmod(n, 4)
return ((c:=a**2)-(a<<1)+1, (d:=c<<2), c<<1, d+(a<<2)+1)[b] # Chai Wah Wu, Aug 21 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Giovanni Resta, Feb 02 2006
STATUS
approved