[go: up one dir, main page]

login
A295706 revision #26

A295706
Primes p for which the difference between p^2 and the square of the next prime is both 1 more and 1 less than a prime.
1
7, 17, 23, 37, 47, 59, 83, 89, 107, 113, 127, 131, 149, 163, 173, 257, 353, 433, 439, 457, 467, 521, 563, 761, 773, 839, 881, 953, 1009, 1031, 1213, 1307, 1319, 1321, 1697, 1733, 1759, 1811, 1861, 1871, 1913, 1979
OFFSET
1,1
COMMENTS
I.e., primes p for which the difference between p^2 and the square of the next prime is the average of a twin prime pair.
EXAMPLE
The primes 7 and 11 are consecutive and their squares are 49 and 121. The difference is 72, and both 71 and 73 are prime.
Likewise, the difference between the square of 563 and the next prime (569) is 6792, and 6791 and 6793 are twin primes.
MATHEMATICA
For[p = 1, p < 10000, p++,
a = Prime[p];
b = Prime[p + 1];
c = b^2 - a^2;
d = (c + 1);
e = (c - 1);
If[And[PrimeQ[d] == True, PrimeQ[e] == True], Print[a]];
]
(* Second program: *)
Select[Partition[Prime@ Range@ 300, 2, 1], AllTrue[{# + 1, # - 1}, PrimeQ] &[#2^2 - #1^2] & @@ # &][[All, 1]] (* Michael De Vlieger, Dec 03 2017 *)
PROG
(PARI) lista(nn) = { my(pp=2); forprime(p=3, nn, my(d=p^2-pp^2); if(isprime(d+1) && isprime(d-1), print1(pp, ", ")); pp=p); } \\ Iain Fox, Dec 03 2017
CROSSREFS
Cf. A014574 (average of twin prime pairs), A069482 (difference between squares of consecutive primes).
Sequence in context: A088546 A265816 A246717 * * A265792 A322669
KEYWORD
nonn
AUTHOR
Geoffrey Marnell, Nov 25 2017
STATUS
editing