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.

A115880 Largest positive x satisfying the Diophantine equation x^2 = y*(y+n), a(n)=0 if there are no solutions.

Original entry on oeis.org

0, 0, 2, 0, 6, 4, 12, 3, 20, 12, 30, 8, 42, 24, 56, 15, 72, 40, 90, 24, 110, 60, 132, 35, 156, 84, 182, 48, 210, 112, 240, 63, 272, 144, 306, 80, 342, 180, 380, 99, 420, 220, 462, 120, 506, 264, 552, 143, 600, 312, 650, 168, 702, 364, 756, 195, 812, 420, 870
Offset: 1

Views

Author

Giovanni Resta, Feb 02 2006

Keywords

Comments

Notice that x^2 = y*(y+n) is equivalent to (n+2*y+2*x)*(n+2*y-2*x) = n^2. We take the factorization of n^2 into two factors congruent mod 4 where one is as small as possible and the other is as large as possible. For n == 0 mod 4 the factors are 4 and n^2/4, for n == 2 mod 4 they are 2 and n^2/2, for n odd they are 1 and n^2. - Robert Israel, Jun 27 2014

Examples

			a(15)=56 since the solutions (x,y) to x^2=y(y+15) are (4,1), (10,5), (18, 12) and (56, 49). The largest x is 56, from (x,y)=(56,49).
		

Crossrefs

Programs

  • Mathematica
    Table[Max[x/.Solve[{x^2==y(y+n),x>0},{x,y},Integers]],{n,1,100}]/.x->0 (* Vaclav Kotesovec, Jun 26 2014 *)
  • Python
    def A115880(n):
        a, b = divmod(n,4)
        return (a**2-1,(c:=a<<1)*(c+1),c*(a+1),c*(c+3)+2)[b] # Chai Wah Wu, Aug 21 2024

Formula

Empirical g.f.: x^3*(x^9-2*x^6-3*x^5-6*x^4-4*x^3-6*x^2-2) / ((x-1)^3*(x+1)^3*(x^2+1)^3). - Colin Barker, Jun 26 2014
a(4*j) = j^2 - 1,
a(4*j+1) = 4*j^2+2*j,
a(4*j+2) = 2*j^2+2*j,
a(4*j+3) = 4*j^2+6*j+2. (see Comments) - Robert Israel, Jun 27 2014