login
Primes congruent to {1, 3, 7, 9} mod 20.
15

%I #25 May 22 2022 09:49:24

%S 3,7,23,29,41,43,47,61,67,83,89,101,103,107,109,127,149,163,167,181,

%T 223,227,229,241,263,269,281,283,307,347,349,367,383,389,401,409,421,

%U 443,449,461,463,467,487,503,509,521,523,541,547,563,569,587,601,607,641

%N Primes congruent to {1, 3, 7, 9} mod 20.

%C Rational primes that decompose in the field Q(sqrt(-5)). - _N. J. A. Sloane_, Dec 25 2017

%D Dirichlet & Dedekind, Lectures on Number Theory (English Translation 1999), p. 119.

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

%H <a href="https://oeis.org/index/Pri#primes_decomp_of">Index to sequences related to decomposition of primes in quadratic fields</a>

%F a(n) ~ 2n log n. - _Charles R Greathouse IV_, Nov 29 2016

%F Legendre symbol (-5, a(n)) = +1. One sets (-5, 5) = 0 and for odd primes p == -1, -3, -7, -9 (mod 20) (-5, p) = -1, given in A003626. - _Wolfdieter Lang_, Mar 05 2021

%t a = {}; Do[If[MemberQ[{1, 3, 7, 9}, Mod[Prime[n], 20]], AppendTo[a, Prime[n]]], {n, 1, 200}]; a (*Artur Jasinski*)

%t Select[Prime[Range[200]],MemberQ[{1,3,7,9},Mod[#,20]]&] (* _Vincenzo Librandi_, Aug 15 2012 *)

%o (Magma) [ p: p in PrimesUpTo(700) | p mod 20 in [1,3,7,9] ]; // _Vincenzo Librandi_, Aug 15 2012

%o (PARI) select(p->my(k=p%20); k==1 || k==3 || k==7 || k==9, primes(100)) \\ _Charles R Greathouse IV_, Nov 29 2016

%Y Cf. A296922, A003626.

%K nonn,easy

%O 1,1

%A _Artur Jasinski_, Apr 25 2008