%I M2882 #73 Apr 05 2023 17:29:58
%S 3,11,19,43,59,67,83,107,131,139,163,179,211,227,251,283,307,331,347,
%T 379,419,443,467,491,499,523,547,563,571,587,619,643,659,683,691,739,
%U 787,811,827,859,883,907,947,971,1019,1051,1091,1123,1163,1171,1187
%N Primes == 3 (mod 8).
%C Primes of the form 3x^2 + 2xy + 3y^2 with x and y in Z. - _T. D. Noe_, May 07 2005
%C Also, primes of the form X^2 + 2Y^2, X=|x-y|, Y=x+y. - _Zak Seidov_, Dec 06 2011
%C Each term is the sum of no fewer than three positive squares. - _T. D. Noe_, Nov 15 2010
%C Smallest terms expressible as sum of three distinct positive squares: 59 = 1^2 + 3^2 + 7^2, 83 = 3^2 + 5^2 + 7^2, 107, 131, 139, 179, 211, 227, 251, 283, 307. - _Zak Seidov_, Dec 06 2011
%C Except for the first term it appears that the terms of the sequence are also primes of the form 2k+1 such that 3*(2k+1) divides 2^k+1. - _Hilko Koning_, Dec 06 2019
%C From _Hilko Koning_, Nov 24 2021: (Start)
%C Theorem (Legendre symbol): With p an odd prime and a an integer coprime to p the Legendre symbol L(a/p) = -1 if a is a quadratic non-residue (mod p) and L(2/p) = -1 if p == +-3 (mod 8).
%C Theorem (Euler's criterion): L(a/p) == a^((p-1)/2) (mod p) so with a = 2 and prime p = 2k + 1 then -1 == 2^k (mod (2k+1)). So prime numbers 2k+1 = +-3 (mod 8) are the prime numbers 2k+1 | 2^k+1.
%C If 2k+1 == -3 (mod 8) then k is even and 2^k+1 is not divisible by 3 and if 2k+1 == +3 (mod 8) then k is odd and 2^k+1 is divisible by 3.
%C Hence prime numbers 2k+1 == 3 (mod 8) are prime numbers such that 3*(2k+1) | 2^k+1. Or, including the first term of the sequence, prime numbers 2k+1 with k odd such that 2k+1 | 2^k+1.
%C (End)
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Ray Chandler, <a href="/A007520/b007520.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from T. D. Noe)
%H M. Abramowitz and I. A. Stegun, eds., <a href="http://www.convertit.com/Go/ConvertIt/Reference/AMS55.ASP">Handbook of Mathematical Functions</a>, National Bureau of Standards, Applied Math. Series 55, Tenth Printing, 1972 [alternative scanned copy].
%H Alexander Kalmynin, <a href="https://arxiv.org/abs/1611.00417">On Novák numbers</a>, arXiv:1611.00417 [math.NT], 2016. See P0 in Theorem 7 p. 11.
%p A007520 := proc(n)
%p option remember;
%p local a;
%p if n = 1 then
%p return 3;
%p end if;
%p a := nextprime(procname(n-1)) ;
%p while modp(a,8) <> 3 do
%p a := nextprime(a) ;
%p end do:
%p a ;
%p end proc:
%p seq(A007520(n),n=1..30) ; # _R. J. Mathar_, Apr 07 2017
%t lst={};Do[p=8*n+3;If[PrimeQ[p], AppendTo[lst, p]], {n, 0, 10^3}];lst (* _Vladimir Joseph Stephan Orlovsky_, Aug 22 2008 *)
%t p=3;k=0;nn=1000;Reap[While[k<nn,If[PrimeQ[p],k++;Sow[p]];p=p+8]][[2,1]] (* _Zak Seidov_, Dec 06 2011 *)
%t Select[Prime[Range[200]],Mod[#,8]==3&] (* _Harvey P. Dale_, Apr 05 2023 *)
%o (PARI) forprime(p=2,97,if(p%8==3,print1(p", "))) \\ _Charles R Greathouse IV_, Aug 17 2011
%o (Magma) [p: p in PrimesUpTo(2000) | p mod 8 eq 3]; // _Vincenzo Librandi_, Aug 07 2012
%Y Cf. A294912, A045339 (for n >= 2).
%K nonn,easy
%O 1,1
%A _N. J. A. Sloane_, _Robert G. Wilson v_
|