login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A256753 Numbers n such that n is both the average of some twin prime pair p, q (q = p+2) (i.e., n = p+1 = q-1) and is also the average of the prime before p and the prime after q. 18
12, 18, 30, 42, 60, 102, 108, 228, 270, 312, 420, 462, 570, 600, 858, 882, 1050, 1092, 1230, 1290, 1302, 1428, 1488, 1620, 1872, 1998, 2028, 2340, 2550, 2688, 2730, 3390, 3462, 3540, 3582, 4020, 4230, 4242, 4272, 4338, 4518, 4650, 4788 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
This sequence is a subsequence of A014574 (average of twin prime pairs).
LINKS
Eric Weisstein's World of Mathematics, Twin Primes
EXAMPLE
For n=12: 7, 11, 13, 17 are four consecutive primes with 13 = 11 + 2 and (7+17)/2 = 12.
For n=18: 13, 17, 19, 23 are four consecutive primes with 19 = 17 + 2 and (13+23)/2 = 18.
MATHEMATICA
Select[Prime[Range[10^3]], PrimeQ[#+2]&&2*#+2==NextPrime[#, -1]+NextPrime[#, 2]&]+1 (* Ivan N. Ianakiev, Apr 23 2015 *)
Select[Partition[Prime[Range[700]], 4, 1], #[[3]]-#[[2]]==2&&(#[[1]]+#[[4]])/2 == (#[[2]]+#[[3]])/2&][[All, 2]]+1 (* Harvey P. Dale, May 06 2022 *)
PROG
(Python)
from sympy import isprime, prevprime, nextprime
for i in range(5, 12001, 2):
..if isprime(i) and isprime(i+2):
....if prevprime(i)+nextprime(i, 2) == 2*(i+1): print(i+1, end=', ')
(PARI) lista(nn) = {forprime(p=3, nn, if (isprime(p+2), if (precprime(p-1)+nextprime(p+3) == 2*(p+1), print1(p+1, ", ")); ); ); } \\ Michel Marcus, Apr 12 2015
CROSSREFS
Cf. A077800 (twin primes), A014574.
Sequence in context: A112054 A225576 A275082 * A167597 A138636 A075281
KEYWORD
nonn
AUTHOR
Karl V. Keller, Jr., Apr 09 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 16:45 EDT 2024. Contains 371989 sequences. (Running on oeis4.)