OFFSET
1,1
COMMENTS
One could generate a larger sequence using any three primes p,q,r such that p^2 + 1 = q^2 + r^2. One could consider these "almost prime Pythagorean triangles."
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
For the consecutive pair (19,23), 23^2 - 19^2 + 1 = 169 = 13^2; thus 19 is in the sequence.
MAPLE
a := proc (n) if isprime(sqrt(nextprime(ithprime(n))^2-ithprime(n)^2+1)) = true then ithprime(n) else end if end proc: seq(a(n), n = 1 .. 2000); # Emeric Deutsch, Mar 07 2009
MATHEMATICA
ltcpQ[{a_, b_}]:=PrimeQ[Sqrt[b^2-a^2+1]]; Select[Partition[ Prime[ Range[ 2000]], 2, 1], ltcpQ][[All, 1]] (* Harvey P. Dale, Jul 23 2021 *)
PROG
(PARI) list(lim)=my(v=List(), p=2, t); forprime(q=3, nextprime(lim\1+1), if(issquare(q^2-p^2+1, &t)&&isprime(t), listput(v, p)); p=q); Vec(v) \\ Charles R Greathouse IV, Jan 31 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot, Mar 05 2009
EXTENSIONS
More terms from Klaus Brockhaus, Mar 05 2009
More terms from Emeric Deutsch, Mar 07 2009
STATUS
approved