%I #75 Feb 20 2024 02:33:54
%S 2,3,8,11,12,18,23,26,27,32,39,44,47,48,50,59,66,71,72,74,75,83,92,98,
%T 99,104,107,108,111,122,128,131,138,143,146,147,156,162,167,176,179,
%U 183,188,191,192,194,200,207,218,219,227,234,236,239,242,243,251,263,264,275,282,284
%N Positive numbers of the form 3*y^2 - x^2.
%C Positive integers k such that x^2 - 4xy + y^2 + k = 0 has integer solutions. (See the CROSSREFS section for sequences relating to solutions for particular k.)
%C Comments on method used, from _Colin Barker_, Jun 06 2014: (Start)
%C In general, we want to find the values of f, from 1 to 400 say, for which x^2 + bxy + y^2 + f = 0 has integer solutions for a given b.
%C In order to solve x^2 + bxy + y^2 + f = 0 we can solve the Pellian equation x^2 - Dy^2 = N, where D = b*b - 4 and N = 4*(b*b - 4)*f.
%C But since sqrt(D) < N, the classical method of solving x^2 - Dy^2 = N does not work. So I implemented the method described in the 1998 sci.math reference, which says:
%C "There are several methods for solving the Pellian equation when |N| > sqrt(d). One is to use a brute-force search. If N < 0 then search on y = sqrt(abs(n/d)) to sqrt((abs(n)(x1 + 1))/(2d)) and if N > 0 search on y = 0 to sqrt((n(x1 - 1))/(2d)) where (x1, y1) is the minimum positive solution (x, y) to x^2 - dy^2 = 1. If N < 0, for each positive (x, y) found by the search, also take (-x, y). If N > 0, also take (x, -y). In either case, all positive solutions are generated from these using (x1, y1) in the standard way."
%C Incidentally all my Pell code is written in B-Prolog, and is somewhat voluminous. (End)
%C Also, positive integers of the form -x^2 + 2xy + 2y^2 of discriminant 12. - _N. J. A. Sloane_, May 31 2014 [Corrected by _Klaus Purath_, May 07 2023]
%C The equivalent sequence for x^2 - 3xy + y^2 + k = 0 is A031363.
%C The equivalent sequence for x^2 - 5xy + y^2 + k = 0 is A237351.
%C A positive k does not appear in this sequence if and only if there is no integer solution of x^2 - 3*y^2 = -k with (i) 0 < y^2 <= k/2 and (ii) 0 <= x^2 <= k/2. See the Nagell reference Theorems 108 a and 109, pp. 206-7, with D = 3, N = k and (x_1,y_1) = (2,1). - _Wolfdieter Lang_, Jan 09 2015
%C From _Klaus Purath_, May 07 2023: (Start)
%C There are no squares in this sequence. Products of an odd number of terms as well as products of an odd number of terms and any terms of A014209 belong to the sequence.
%C Products of an even number of terms are terms of A014209. The union of this sequence and A014209 is closed under multiplication.
%C A positive number belongs to this sequence if and only if it contains an odd number of prime factors congruent to {2, 3, 11} modulo 12. If it contains prime factors congruent to {5, 7} modulo 12, these occur only with even exponents. (End)
%C From _Klaus Purath_, Jul 09 2023: (Start)
%C Any term of the sequence raised to an odd power also belongs to the sequence. Proof: t^(2n+1) = t*t^2n = (3*x^2 - y^2)*t^2n = 3*(x*t^n)^2 - (y*t^n)^2. It seems that t^(2n+1) occurs only if t also is in the sequence.
%C Joerg Arndt has proved that there are no squares in this sequence: Assume s^2 = 3*y^2 - x^2, then s^2 + x^2 = 3 * y^2, but the sum of two squares cannot be 3 * y^2, qed. (End)
%C That products of any 3 terms belong to the sequence can be proved by the following identity: (na^2 - b^2) (nc^2 - d^2) (ne^2 - f^2) = n[a(nce + df) + b(cf + de)]^2 - [na(cf + de) + b(nce + df)]^2. This can be verified by expanding both sides of the equation. - _Klaus Purath_, Jul 14 2023
%D T. Nagell, Introduction to Number Theory, Chelsea Publishing Company, New York, 1964.
%H Sci.math, <a href="http://www.math.niu.edu/~rusin/known-math/98/pells">General Pell equation: x^2 - N*y^2 = D</a>, 1998
%H Sci.math, <a href="http://oeis.org/A035251/a035251.txt">General Pell equation: x^2 - N*y^2 = D</a>, 1998 (Edited and cached copy)
%H N. J. A. Sloane et al., <a href="https://oeis.org/wiki/Binary_Quadratic_Forms_and_OEIS">Binary Quadratic Forms and OEIS</a> (Index to related sequences, programs, references)
%e 11 is in the sequence because 3 * 3^2 - 4^2 = 27 - 16 = 11.
%e 12 is in the sequence because 3 * 4^2 - 6^2 = 48 - 36 = 12.
%e 13 is not in the sequence because there is no solution in integers to 3y^2 - x^2 = 13.
%e From _Wolfdieter Lang_, Jan 09 2015: (Start)
%e Referring to the Jan 09 2015 comment above.
%e k = 1 is out because there is no integer solution of (i) 0 < y^2 <= 1/2.
%e For k = 4, 5, 6, and 7 one has y = 1, x = 0, 1 (and the negative of this). But x^2 - 3 is not -k for these k and x values. Therefore, these k values are missing.
%e For k = 8 .. 16 one has y = 1, 2 and x = 0, 1, 2. Only y = 2 has a chance and only for k = 8, 11 and 12 the x value 2, 1 and 0, respectively, solves x^2 - 12 = -k. Therefore 9, 10, 13, 14, 15, 16 are missing.
%e ... (End)
%t r[n_] := Reduce[n == 3*y^2 - x^2 && x > 0 && y > 0, {x, y}, Integers]; Reap[For[n = 1, n <= 1000, n++, rn = r[n]; If[rn =!= False, Print["n = ", n, ", ", rn /. C[1] -> 1 // Simplify]; Sow[n]]]][[2, 1]] (* _Jean-François Alcover_, Jan 21 2016 *)
%t Select[Range[300],Length[FindInstance[3y^2-x^2==#,{x,y},Integers]]>0&] (* _Harvey P. Dale_, Apr 23 2023 *)
%Y With respect to solutions of the equation in the early comment, see comments etc. in: A001835 (k = 2), A001075 (k = 3), A237250 (k = 11), A003500 (k = 12), A082841 (k = 18), A077238 (k = 39).
%Y Cf. A031363, A237351.
%Y A141123 gives the primes.
%Y For a list of sequences giving numbers and/or primes represented by binary quadratic forms, see the "Binary Quadratic Forms and OEIS" link.
%K nonn,easy
%O 1,1
%A _Roger Cuculière_, Jul 14 2003
%E Terms 26 and beyond from _Colin Barker_, Feb 06 2014