login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A087879 Primes of the form (4n+1)^2 + (4m+2)^2, m,n >= 0. 1

%I #11 Aug 26 2018 20:15:17

%S 5,29,37,61,101,173,181,197,269,277,293,349,389,509,541,613,653,661,

%T 677,701,757,773,821,877,941,1069,1093,1109,1117,1181,1237,1301,1373,

%U 1597,1613,1693,1733,1741,1789,1877,1933,1997,2029,2053,2069,2141,2221,2269

%N Primes of the form (4n+1)^2 + (4m+2)^2, m,n >= 0.

%H Robert Israel, <a href="/A087879/b087879.txt">Table of n, a(n) for n = 1..10000</a>

%p N:= 10000:

%p A:= NULL:

%p for x from 1 by 4 while x^2 < N do

%p for y from 2 by 4 while x^2 + y^2 < N do

%p v:= x^2 + y^2;

%p if isprime(v) then A:= A,v fi

%p od od:

%p sort(convert({A},list)); # _Robert Israel_, Aug 26 2018

%o Contribution from _Michael B. Porter_, Dec 10 2009: (Start)

%o (PARI) /* numbers of the form (4x+1)^2 + (4y+2)^2 for x,y >= 0 */

%o /* largest possible x */

%o xm(n)=floor((sqrt(n-4)-1)/4)

%o /* determine if n - (4x+1)^2 is a square, and put the square root into a */

%o isform(n)={local(r,a);r=0;for(x=0,xm(n),if(issquare(n-(4*x+1)^2,a),if(Mod(a,4)==Mod(2,4),r=1)));r}

%o /* skip isform() calculation if possible */

%o isA087879(n) = if(n>4 && Mod(n,2)==Mod(1,2) && isprime(n),isform(n),0) (End)

%K nonn

%O 1,1

%A _Cino Hilliard_, Oct 11 2003

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 12:27 EDT 2024. Contains 371912 sequences. (Running on oeis4.)