1/a1a3+1/a2a4+...+1/anan+2
=1/2d[1/a1-1/a3+1/a2-1/a4+1/a3-1/a5+1/a4-1/a6+.
+1/a(n-2)-1/an+1/a(n-1)-1/a(n+1)+1/an-1/a(n+2)]
=1/2d[1/a1+1/a2-1/a(n+1)-1/a(n+2)]
1/a1a3+1/a2a4+...+1/anan+2
=1/2d[1/a1-1/a3+1/a2-1/a4+1/a3-1/a5+1/a4-1/a6+.
+1/a(n-2)-1/an+1/a(n-1)-1/a(n+1)+1/an-1/a(n+2)]
=1/2d[1/a1+1/a2-1/a(n+1)-1/a(n+2)]