login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A130761
Primes prime(n) such that at least one of the two numbers (prime(n+2)^2-prime(n)^2)/2 - 1 and (prime(n+2)^2-prime(n)^2)/2 + 1 is prime.
8
3, 5, 7, 11, 13, 19, 29, 31, 37, 41, 43, 53, 59, 61, 67, 71, 79, 83, 97, 107, 127, 139, 149, 157, 179, 181, 191, 197, 227, 229, 239, 251, 263, 283, 293, 307, 347, 349, 353, 373, 419, 439, 443, 463, 467, 479, 499, 523, 541, 569, 601, 607, 613, 617, 619
OFFSET
1,1
LINKS
EXAMPLE
(7^2 - 3^2)/2 - 1 is 19. Therefore 3 is in the sequence.
(19^2 - 13^2)/2 + 1 is 97. Hence 13 is in the sequence.
MAPLE
Res:= NULL:
p:= 5: q:= 3:
count:= 0:
while count < 100 do
r:= q; q:= p; p:= nextprime(p);
v:= (p^2-r^2)/2;
if isprime(v+1) or isprime(v-1) then
count:= count+1; Res:= Res, r;
fi
od:
Res; # Robert Israel, Oct 03 2018
MATHEMATICA
Prime[Select[Range[140], PrimeQ[(Prime[ #+2]^2-Prime[ # ]^2)/2+1] || PrimeQ[(Prime[ # +2]^2-Prime[ # ]^2)/2-1] &]]
Select[Partition[Prime[Range[200]], 3, 1], AnyTrue[(#[[3]]^2-#[[1]]^2)/2+{1, -1}, PrimeQ]&][[All, 1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 28 2020 *)
CROSSREFS
Sequence in context: A020575 A055072 A059334 * A154966 A072667 A092729
KEYWORD
nonn,less
AUTHOR
J. M. Bergot, Jul 13 2007
EXTENSIONS
Edited and extended by Stefan Steinerberger, Jul 23 2007
STATUS
approved