cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A062047 Sum of odd numbers between consecutive primes.

Original entry on oeis.org

0, 0, 0, 9, 0, 15, 0, 21, 52, 0, 68, 39, 0, 45, 100, 112, 0, 128, 69, 0, 152, 81, 172, 279, 99, 0, 105, 0, 111, 720, 129, 268, 0, 576, 0, 308, 320, 165, 340, 352, 0, 744, 0, 195, 0, 1025, 1085, 225, 0, 231, 472, 0, 984, 508, 520, 532, 0, 548, 279, 0, 1152, 1800, 309, 0
Offset: 1

Views

Author

Amarnath Murthy, Jun 06 2001

Keywords

Examples

			a(4) = 9 is the single odd number between 7 and 11.
		

Crossrefs

Programs

  • Mathematica
    Plus@@Range[ #[[1]]+2,#[[2]]-2,2]&/@Partition[Prime[Range[100]],2,1] (* Harvey P. Dale, Aug 13 2009 *)
  • 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

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.

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