login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A305558 If (p1,p2) is the n-th twin prime pair and p the prime before p1 and q the prime after p2 then a(n) = p + q - (p1 + p2). 0
1, 2, 0, 0, 0, 0, 0, 2, 0, 0, 4, -4, 4, -6, 8, 0, 4, 0, 6, 0, -6, 0, -4, 0, 6, 0, 0, 8, -6, 6, -2, -6, 6, 0, 0, 4, -4, 0, -4, 0, -12, 0, -14, 0, 0, -6, 0, 2, -6, 0, -2, 0, 20, 6, -2, 8, 0, 6, -2, 6, 0, 0, -8, 6, 4, -10, 6, -12, -12, 10, 0, 2, 0, 4, -6, 0, 2, 0, -6, 12, 22, -18, 6, 8, -18, 8, -22, 6, -2, 6, 0, 0, 18, -6 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Table of n, a(n) for n=1..94.

FORMULA

a(n) = A000040(A029707(n)-1) + A000040(A107770(n)+1) - (A001359(n) + A006512(n)). - Jianing Song, Jun 22 2018

EXAMPLE

For n = 8, the 8th prime pair is (71, 73), the prime before 71 is 67 and prime after 73 is 79. So a(8) = 67 + 79 - 71 - 73 = 2.

MATHEMATICA

Map[#1 + #4 - (#2 + #3) & @@ # &, Select[Partition[Prime@ Range[500], 4, 1], And[#3 - #2 == 2] & @@ # &]] (* Michael De Vlieger, Jun 30 2018 *)

PROG

(PARI) {

print1(2+7-(5+3)", ");

forstep(n=6, 100, 6,

        if(isprime(n-1)&&isprime(n+1),

           a=precprime(n-2); b=nextprime(n+2);

           print1(a+b-2*n", ")

          )

       )

}

CROSSREFS

Cf. A001097, A054735, A036263.

Sequence in context: A132976 A143840 A028649 * A097798 A065205 A036272

Adjacent sequences:  A305555 A305556 A305557 * A305559 A305560 A305561

KEYWORD

sign,easy

AUTHOR

Dimitris Valianatos, Jun 21 2018

EXTENSIONS

Definition clarified by Jianing Song, Jun 22 2018

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 22 15:23 EDT 2019. Contains 325224 sequences. (Running on oeis4.)