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!)
A257119 Smallest member of four consecutive prime numbers each of which is the sum of two squares. 1

%I #26 Jul 03 2016 00:14:43

%S 389,757,1193,2593,2609,3037,3209,3413,3433,5233,6829,7649,8669,8677,

%T 9157,9241,10169,10429,11173,11593,11597,11617,11621,11633,11657,

%U 12269,12277,12409,12413,12829,12841,15053,17389

%N Smallest member of four consecutive prime numbers each of which is the sum of two squares.

%C This sequence is a subset of A257118.

%H Abhiram R Devesh, <a href="/A257119/b257119.txt">Table of n, a(n) for n = 1..100</a>

%e a(1)=389 ; 389 = 10^2 + 17ยจ2; 397 = 6^2 + 19^2; 401 = 1^2 + 20^2; 409 = 3^2 + 20^2.

%o (Python)

%o import sympy

%o def sumpow(sn0,n,p):

%o ....af=0;bf=0;an=1

%o ....sn1=sn0+n

%o ....if n!=0:

%o ........sn1=sympy.nextprime(sn0,n)

%o ....while an**p<sn1:

%o ........bnsq=sn1-(an**p)

%o ........bn=sympy.ntheory.perfect_power(bnsq)

%o ........if bn!=False and list(bn)[1]==p:

%o ............af=an

%o ............bf=list(bn)[0]

%o ............an=sn1+100

%o ........an=an+1

%o ....return(af,bf)

%o s0=1; pw=2

%o while s0>0:

%o ....a0,b0=sumpow(s0,0,pw)

%o ....a1,b1=sumpow(s0,1,pw)

%o ....a2,b2=sumpow(s0,2,pw)

%o ....a3,b3=sumpow(s0,3,pw)

%o ....if a0!=0 and a1!=0 and a2!=0 and a3!=0:

%o ........print(s0)

%o ....s0=sympy.nextprime(s0)

%Y Cf. A257117 (with two consecutive primes), A257118 (with three consecutive primes).

%K nonn,easy

%O 1,1

%A _Abhiram R Devesh_, Apr 25 2015

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 July 30 12:41 EDT 2024. Contains 374743 sequences. (Running on oeis4.)