OFFSET
1,2
COMMENTS
a(n) is divisible by 3.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
a(1) = 0 because (3,5) is adjacent to (5,7); a(2) = 3 because the numbers 8, 9 and 10 are between (5,7) and (11,13), ...
MAPLE
T:=array(1..100, 1..2):k:=0:for n from 1 to 1000 do:p1:=ithprime(n):p2:=ithprime(n+1):if p2-p1 = 2 then k:=k+1:T[k, 1]:=p1:T[k, 2]:=p2:else fi:od: for p from 2 to k do:x:= T[p+1, 1]- T[p, 2]: printf(`%d, `, x-1):od:
MATHEMATICA
Module[{tr=Transpose[Select[Partition[Prime[Range[450]], 2, 1], #[[2]]- #[[1]] == 2&]], fir, las}, fir=Rest[tr[[1]]]; las=Most[tr[[2]]]; Flatten[Abs[ Differences/@ Thread[{fir, las}]]]-1/.{-1->0}] (* Harvey P. Dale, Jun 11 2014 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Jan 10 2012
STATUS
approved