login
a(n) is the largest positive y satisfying the Diophantine equation x^2=y(y+n). a(n)=0 if there are no solutions.
4

%I #22 Aug 22 2024 09:18:13

%S 0,0,1,0,4,2,9,1,16,8,25,4,36,18,49,9,64,32,81,16,100,50,121,25,144,

%T 72,169,36,196,98,225,49,256,128,289,64,324,162,361,81,400,200,441,

%U 100,484,242,529,121,576,288,625,144,676,338,729,169,784,392,841,196

%N a(n) is the largest positive y satisfying the Diophantine equation x^2=y(y+n). a(n)=0 if there are no solutions.

%C The corresponding least y is given by A067721(n).

%H Vincenzo Librandi, <a href="/A115881/b115881.txt">Table of n, a(n) for n = 1..1000</a>

%F 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

%F 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

%F From _Chai Wah Wu_, Aug 21 2024: (Start)

%F a(4*j) = j^2 - 2*j + 1,

%F a(4*j+1) = 4*j^2,

%F a(4*j+2) = 2*j^2,

%F a(4*j+3) = 4*j^2+4*j+1 (see A115880).

%F (End)

%e 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).

%t Table[Max[y/.Solve[{x^2==y*(y+n),y>0},{x,y},Integers]],{n,1,100}]/.y->0 (* _Vaclav Kotesovec_, Jun 26 2014 *)

%o (Python)

%o def A115881(n):

%o a, b = divmod(n,4)

%o return ((c:=a**2)-(a<<1)+1,(d:=c<<2),c<<1,d+(a<<2)+1)[b] # _Chai Wah Wu_, Aug 21 2024

%Y Cf. A067721, A115878, A115879, A115880.

%K nonn

%O 1,5

%A _Giovanni Resta_, Feb 02 2006