%I #19 Aug 05 2014 14:16:28
%S 3,5,23,31,37,47,53,59,67,89,97,113,157,163,179,181,191,199,251,257,
%T 269,311,313,317,331,367,379,383,389,401,419,433,443,449,463,487,499,
%U 509,521,577,587,599,617,641,643,647,653,683,691,709,719,727,751,757
%N Primes of the form x^2+xy+3y^2, with x and y nonnegative.
%C Discriminant=-11.
%H N. J. A. Sloane and Vincenzo Librarndi, <a href="/A106857/b106857.txt">Table of n, a(n) for n = 1..10000</a> [First 3000 terms from Vincenzo Librarndi]
%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)
%t QuadPrimes2[a_, b_, c_, lmt_] := Module[{p, d, lst = {}, xMax, yMax}, d = b^2 - 4a*c; If[a > 0 && c > 0 && d < 0, xMax = Sqrt[lmt/a]*(1+Abs[b]/Floor[Sqrt[-d]])]; Do[ If[ 4c*lmt + d*x^2 >= 0, yMax = ((-b)*x + Sqrt[4c*lmt + d*x^2])/(2c), yMax = 0 ]; Do[p = a*x^2 + b*x*y + c*y^2; If[ PrimeQ[ p] && !MemberQ[ lst, p], AppendTo[ lst, p]], {y, 0, yMax}], {x, 0, xMax}]; Sort[ lst]];
%t t2 = QuadPrimes2[1, 1, 3, 1000]
%Y A056874 is the main sequence for these primes. Cf. A028954.
%K nonn,easy
%O 1,1
%A _T. D. Noe_, May 09 2005
%E Replaced defective Mma program, extended b-file. - _N. J. A. Sloane_, Jun 16 2014
|