(MAGMAMagma) [ p: p in PrimesUpTo(3000) | p mod 40 in {1, 9} ]; // Vincenzo Librandi, Jul 24 2012
(MAGMAMagma) [ p: p in PrimesUpTo(3000) | p mod 40 in {1, 9} ]; // Vincenzo Librandi, Jul 24 2012
editing
approved
Primes of the form x^2 + 40y^2.
Discriminant = -160. See A107132 for more information.
(PARI) list(lim)=my(v=List(), t); forprime(p=41, lim, t=p%40; if(t==1||t==9, listput(v, p))); Vec(v) \\ Charles R Greathouse IV, Feb 09 2017
approved
editing
Vincenzo Librandi and Ray Chandler, <a href="/A107145/b107145_1.txt">Table of n, a(n) for n = 1..10000</a> [First 1000 terms from Vincenzo Librandi]
editing
approved
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)
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)
QuadPrimesQuadPrimes2[1, 0, 40, 10000] (* see A106856 *)
QuadPrimes[1, 0, 40, 10000] (* see A106856 *) Note: the original QuadPrimes had a bug which could sometimes give wrong answers. This sequence should be checked (unless the coefficient of xy in the quadratic form is zero, in which case QuadPrimes gives correct answers). - N. J. A. Sloane, Jun 04 2014
QuadPrimes[1, 0, 40, 10000] (* see A106856 *)
QuadPrimes[1, 0, 40, 10000] (* see A106856 *) Note: the original QuadPrimes had a bug which could sometimes give wrong answers. This sequence should be checked (unless the coefficient of xy in the quadratic form is zero, in which case QuadPrimes gives correct answers). - N. J. A. Sloane, Jun 04 2014