%I #29 Oct 02 2022 18:12:13
%S 1,7,49,91,637,1729,12103,53599,375193,1983163,13882141,85276009,
%T 596932063,4178524441,5201836549,36412855843,254889990901,
%U 348523048783,2439661341481,17077629390367,25442182561159,178095277928113,1246666945496791,2009932422331561,14069526956320927
%N Numbers k such that k^2 can be represented as x^2 + x*y + y^2 in more ways than for any smaller k.
%C Apparently the number of grid points t(n) = {1, 2, 3, 5, 8, 14, 23, ...} (A357303) in the reduced representations as described in the examples matches t(n) = A087503(n-3) + 2 for n >= 3, i.e., t(n) = t(n-1) + 3*t(n-2) - 3*t(n-3) for n >= 5. This coincidence persists up to t(15) = 1823, but t(16) = 2553, whereas the recurrence predicts 3281, which is t(17). It seems that all of the terms generated by the recurrence also appear as record numbers of grid points. However, there are other record numbers in between, of which 2553 is the first occurrence.
%e The essential information in the complete set of representations of a square a(n)^2 can be extracted by taking into account the symmetries of the triangular lattice. If r is the number of all representations of a(n)^2, then there are t = (r/6 + 1)/2 pairs of triangular oblique coordinates lying in a sector of angular width Pi/6 completely containing the essential information.
%e a(1) = 1: r = 6 representations of 1^2 are [-1, 0], [-1, 1], [0, -1], [0, 1], [1, -1], [1, 0] reduced: (6/6 + 1)/2 = 1 grid point [1,0].
%e a(2) = 7: r = 18 representations of 7^2 = 49 are [-8, 5], [-7, 0], [-7, 7], [-5, -3], [-5, 8], [-3, -5], [-3, 8], [0, -7], [0, 7], [3, -8], [3, 5], [5, -8], [5, 3], [7, -7], [7, 0], [8, -5], [8, -3], [8, 3]; reduced: (18/6 + 1)/2 = 2 grid points [7, 0], [8, 3].
%e After a(2) = 7 there are no squares with more than 18 representations, e.g., r = 18 for 13^2, 14^2, 19^2, 21^2, ..., 42^2, 43^2.
%e a(3) = 49: r = 30 representations of 49^2 = 2401 are [-56, 21], [-56, 35], [-55, 16], [-55, 39], [-49, 0], [-49, 49], [-39, -16], [-39, 55], [-35, -21], [-35, 56], [-21, -35], [-21, 56], [-16, -39], [-16, 55], [0, -49], [0, 49], [16, -55], [16, 39], [21, -56], [21, 35], [35, -56], [35, 21], [39, -55], [39, 16], [49, -49], [49, 0], [55, -39], [55, -16], [56, -35], [56, -21]; reduced: (30/6 + 1)/2 = 3 grid points [49, 0], [55, 16], [56, 21].
%e There are no squares with r > 18 between 49 and 90.
%e a(4) = 91: r = 54 representations of 91^2 = 8281 are [-105,49], [-105,56], ..., [105, -56], [105,-49]; reduced: (54/6 + 1)/2 = 5 grid points [91, 0], [96, 11], [99, 19], [104, 39], [105, 49].
%o (PARI) a357302(upto) = {my (dmax=0);for (k = 1, upto, my (d = #qfbsolve (Qfb(1,1,1), k^2, 3)); if(d > dmax, print1(k,", "); dmax=d))};
%o a357302(400000)
%o (PARI) \\ more efficient using function list_A344473 (see there)
%o a355703(maxexp10)= {my (sqterms=select(x->issquare(x), list_A344473 (10^(2*maxexp10))), r=0); for (k=1, #sqterms, my (d = #qfbsolve(Qfb(1,1,1),v[k],3)); if (d>r, print1(sqrtint(v[k]),", "); r=d))};
%o a355703(17)
%o (Python)
%o from itertools import count, islice
%o from sympy.abc import x,y
%o from sympy.solvers.diophantine.diophantine import diop_quadratic
%o def A357302_gen(): # generator of terms
%o c = 0
%o for k in count(1):
%o if (d:=len(diop_quadratic(x*(x+y)+y**2-k**2))) > c:
%o yield k
%o c = d
%o A357302_list = print(list(islice(A357302_gen(),6))) # _Chai Wah Wu_, Sep 26 2022
%Y Cf. A002324, A003136, A004016, A050931, A088534, A230655, A357303.
%Y Cf. A087503, A246360.
%K nonn
%O 1,2
%A _Hugo Pfoertner_, Sep 25 2022