cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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, 72, 169, 36, 196, 98, 225, 49, 256, 128, 289, 64, 324, 162, 361, 81, 400, 200, 441, 100, 484, 242, 529, 121, 576, 288, 625, 144, 676, 338, 729, 169, 784, 392, 841, 196
Offset: 1

Views

Author

Giovanni Resta, Feb 02 2006

Keywords

Comments

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

Examples

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

Crossrefs

Programs

  • 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 *)
  • 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

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)