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.

A204099 Number of integers between successive twin prime pairs.

Original entry on oeis.org

0, 3, 3, 9, 9, 15, 9, 27, 3, 27, 9, 27, 9, 3, 27, 9, 27, 9, 27, 33, 69, 9, 27, 57, 45, 27, 15, 21, 15, 147, 9, 3, 27, 21, 135, 9, 15, 9, 27, 57, 75, 45, 9, 9, 15, 105, 21, 27, 3, 117, 9, 45, 27, 21, 63, 81, 3, 51, 15, 45, 27, 51, 3, 21, 15, 9, 93, 27, 39
Offset: 1

Views

Author

Michel Lagneau, Jan 10 2012

Keywords

Comments

a(n) is divisible by 3.

Examples

			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), ...
		

Crossrefs

Programs

  • 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 *)

Formula

a(n) = A167132(n) - 1.
a(n) = A063091(n+1) - A063091(n) - 3.