OFFSET
1,1
FORMULA
EXAMPLE
p=179 is a term because 179 - 1 = 3^2 + 13^2 and 179 + 1 = 6^2 + 12^2.
MAPLE
isA004431 := proc(n) local x, y ; for x from 1 do if x^2 > n then RETURN(false); fi; y := n-x^2 ; if y> 0 and issqr(y ) then y := sqrt(y) ; if y <> x then RETURN(true) ; fi; fi; od: end:
for n from 1 to 2000 do p := ithprime(n) ; if isA004431(p-1) and isA004431(p+1) then printf("%d, ", p) ; fi; od: # R. J. Mathar, Jul 02 2009
MATHEMATICA
f[n_]:=Module[{k=1}, While[(n-k^2)^(1/2)!=IntegerPart[(n-k^2)^(1/2)], k++; If[2*k^2>=n, k=0; Break[]]]; k]; lst={}; Do[p=Prime[n]; If[f[p-1]>0&&f[p+1]> 0, AppendTo[lst, p]], {n, 4*6!}]; lst
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Joseph Stephan Orlovsky, Jun 26 2009
EXTENSIONS
Definition corrected, R. J. Mathar, Jul 02 2009
STATUS
approved