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.

A106857 Primes of the form x^2+xy+3y^2, with x and y nonnegative.

Original entry on oeis.org

3, 5, 23, 31, 37, 47, 53, 59, 67, 89, 97, 113, 157, 163, 179, 181, 191, 199, 251, 257, 269, 311, 313, 317, 331, 367, 379, 383, 389, 401, 419, 433, 443, 449, 463, 487, 499, 509, 521, 577, 587, 599, 617, 641, 643, 647, 653, 683, 691, 709, 719, 727, 751, 757
Offset: 1

Views

Author

T. D. Noe, May 09 2005

Keywords

Comments

Discriminant=-11.

Crossrefs

A056874 is the main sequence for these primes. Cf. A028954.

Programs

  • Mathematica
    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]];
    t2 = QuadPrimes2[1, 1, 3, 1000]

Extensions

Replaced defective Mma program, extended b-file. - N. J. A. Sloane, Jun 16 2014