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.

A357019 a(n) is the largest possible x in n = x^2 - x*y + y^2 with integers x > y >= 0, or 0 if n cannot be expressed in this form.

This page as a plain text file.
%I A357019 #16 Sep 12 2022 17:14:19
%S A357019 0,1,0,2,2,0,0,3,0,3,0,0,4,4,0,0,4,0,0,5,0,5,0,0,0,5,0,6,6,0,0,6,0,0,
%T A357019 0,0,6,7,0,7,0,0,0,7,0,0,0,0,8,8,0,0,8,0,0,0,0,8,0,0,0,9,0,9,8,0,0,9,
%U A357019 0,0,0,0,0,9,0,10,10,0,0,10,0,9,0,0,10,0
%N A357019 a(n) is the largest possible x in n = x^2 - x*y + y^2 with integers x > y >= 0, or 0 if n cannot be expressed in this form.
%o A357019 (PARI) dloesch(n) = {my(L=List()); foreach([-1,1], qs, my (D=qfbsolve(Qfb(1,qs,1), factor(n), 3), dnp=#D); for (k=1, dnp, if(D[k][1]^2+D[k][2]^2-abs(D[k][1]*D[k][2])==n, listput (L, [abs(D[k][1]),abs(D[k][2])])))); Set(L)};
%o A357019 for (k=1, 85, my(D=dloesch(k), d=#D, m=0); for (j=1, d, m=max(m,D[j][1]));print1(m,", "))
%o A357019 (Python)
%o A357019 from sympy.abc import x, y
%o A357019 from sympy.solvers.diophantine.diophantine import diop_quadratic
%o A357019 def A357019(n): return max((a for a,b in diop_quadratic(x*(x-y)+y**2-n)),default=0) # _Chai Wah Wu_, Sep 12 2022
%Y A357019 Cf. A002324, A003136, A133388.
%K A357019 nonn
%O A357019 0,4
%A A357019 _Hugo Pfoertner_, Sep 10 2022