OFFSET
1,1
COMMENTS
This sequence is a subsequence of A257117.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..200
EXAMPLE
389 = 10^2 + 17^2, 397 = 6^2 + 19^2, and 401 = 1^2 + 20^2, so 389 is a term.
397 = 6^2 + 19^2, 401 = 1^2 + 20^2, and 409 = 3^2 + 20^2, so 397 is a term.
MATHEMATICA
Prime/@SequencePosition[Table[If[Count[IntegerPartitions[n, {2}], _?(AllTrue[ Sqrt[#], IntegerQ]&)]>0, 1, 0], {n, Prime[Range[3000]]}], {1, 1, 1}, Overlaps-> All] [[All, 1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 08 2018 *)
PROG
(Python)
# a(1) is not displayed.
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)
a2, b2=sumpow(s0, 2, pw)
if a0!=0 and a1!=0 and a2!=0:
print(s0)
s0=sympy.nextprime(s0)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Abhiram R Devesh, Apr 25 2015
EXTENSIONS
Corrected and extended by and prior b-file replaced by Harvey P. Dale, Jul 08 2018
STATUS
approved