OFFSET
1,1
EXAMPLE
13 belongs to the sequence as 13 is prime, 13 is the 6th prime number, the 7th prime is 17, the 8th prime is 19, and 13^2 + 17^2 - 19^2 = 97, which is prime.
31 does not belong to the sequence as 31^2 + 37^2 - 41^2 = 649 and 649 is not prime.
MAPLE
A255581:=n->`if`(isprime(ithprime(n)^2+ithprime(n+1)^2-ithprime(n+2)^2), ithprime(n), NULL): seq(A255581(n), n=1..200); # Wesley Ivan Hurt, Feb 28 2015
PROG
(Octave) p=primes(500); for i=1:100 ris=(p(i))^2+(p(i+1))^2-(p(i+2))^2; if ris>0 if isprime(ris) disp(p(i)); end end end
(PARI) lista(nn) = {forprime(p=2, nn, q = nextprime(p+1); r = nextprime(q+1); if (isprime(p^2+q^2-r^2), print1(p, ", ")); ); } \\ Michel Marcus, Mar 01 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierandrea Formusa, Feb 26 2015
STATUS
approved