|
|
A257117
|
|
Smaller of two consecutive primes each of which is the sum of two squares.
|
|
3
|
|
|
37, 109, 193, 229, 277, 313, 349, 389, 397, 401, 449, 457, 509, 613, 661, 673, 701, 757, 761, 769, 797, 853, 929, 937, 997, 1009, 1093, 1109, 1193, 1201, 1213, 1237, 1373, 1429, 1489, 1549, 1597, 1609, 1637, 1669
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
This sequence is a subsequence of A002313 (Primes of form x^2 + y^2).
|
|
LINKS
|
|
|
EXAMPLE
|
37 = 1^2 + 6^2 and 41 = 4^2 + 5^2, so 37 is a term.
109 = 3^2 + 10^2 and 113 = 7^2 + 8^2, so 109 is a term.
|
|
PROG
|
(Python)
import sympy
def sumpow(sn0, n, p):
....af=0; bf=0; an=1
....sn1=sn0+n
....if n!=0:
........sn1=sympy.nextprime(sn0, n)
....while an**p<sn1:
........bnsq=sn1-(an**p)
........bn=sympy.ntheory.perfect_power(bnsq)
........if bn!=False and list(bn)[1]==p:
............af=an
............bf=list(bn)[0]
............an=sn1+100
........an=an+1
....return(af, bf)
s0=1; pw=2
while s0>0:
....a0, b0=sumpow(s0, 0, pw)
....a1, b1=sumpow(s0, 1, pw)
....if a0!=0 and a1!=0:
........print(s0)
....s0=sympy.nextprime(s0)
|
|
CROSSREFS
|
Cf. A002313 (Primes of form x^2 + y^2).
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|