login
Primes congruent to {0, 1, 2, 4} mod 7.
12

%I #29 Sep 08 2022 08:44:55

%S 2,7,11,23,29,37,43,53,67,71,79,107,109,113,127,137,149,151,163,179,

%T 191,193,197,211,233,239,263,277,281,317,331,337,347,359,373,379,389,

%U 401,421,431,443,449,457,463,487

%N Primes congruent to {0, 1, 2, 4} mod 7.

%C Primes of the form x^2 + xy + 2y^2, discriminant -7. - _N. J. A. Sloane_, Jun 01 2014

%C Primes of the form x^2 - xy + 2y^2 with x and y nonnegative. - _T. D. Noe_, May 07 2005

%C Also, primes which are squares (mod 7) (or, (mod 14): see A191017 for a sequence formerly defined as such). - _M. F. Hasler_, Jan 15 2016

%H Vincenzo Librandi, <a href="/A045373/b045373.txt">Table of n, a(n) for n = 1..1000</a>

%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 Select[Prime[Range[500]],MemberQ[{0,1,2,4},Mod[#,7]]&] (* _Vincenzo Librandi_, Jul 13 2012 *)

%o (Magma) [p: p in PrimesUpTo(740)|p mod 7 in [0, 1, 2, 4]]; // _Vincenzo Librandi_, Jul 13 2012

%o (PARI) select(p->issquare(Mod(p,7))&&isprime(p),[1..1000]) \\ _M. F. Hasler_, Jan 15 2016

%Y Primes in A028951.

%Y Cf. A191017, A003625 (complement).

%K nonn

%O 1,1

%A _N. J. A. Sloane_