OFFSET
1,4
LINKS
Harry J. Smith, Table of n, a(n) for n=1..1000
FORMULA
a(n) = {prime(n+1) + prime(n)}*{prime(n+1) - prime(n)-2}/4.
a(n) = (prime(n)+e(n) )*( e(n)-1 ), where e(n) = A001223(n) / 2, for n > 1.
EXAMPLE
a(4) = 9 is the single odd number between 7 and 11.
MATHEMATICA
Plus@@Range[ #[[1]]+2, #[[2]]-2, 2]&/@Partition[Prime[Range[100]], 2, 1] (* Harvey P. Dale, Aug 13 2009 *)
PROG
(PARI) { for (n=1, 1000, q=prime(n + 1); p=prime(n); a=(q + p)*(q - p - 2)/4; if (n==1, a=0); write("b062047.txt", n, " ", a) ) } \\ Harry J. Smith, Jul 30 2009
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Jun 06 2001
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org) and Jason Earls, Jun 07 2001
OFFSET changed from 0 to 1 by Harry J. Smith, Jul 30 2009
STATUS
approved