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.

A098015 Indices x such that (1/2)(prime(x+1) - prime(x)) is prime.

Original entry on oeis.org

4, 6, 8, 9, 11, 12, 14, 15, 16, 18, 19, 21, 22, 23, 25, 27, 29, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 48, 50, 51, 53, 54, 55, 56, 58, 59, 61, 62, 63, 65, 66, 67, 68, 70, 71, 73, 74, 75, 76, 78, 80, 82, 84, 85, 86, 88, 90, 93, 95, 96, 100, 101, 102, 103, 105, 106, 107, 108
Offset: 1

Views

Author

Cino Hilliard, Sep 09 2004

Keywords

Examples

			Difference between prime(4) and prime(4+1) = 4. 1/2(4) = 2. So 4 is first entry in the table.
		

Programs

  • Maple
    R:= NULL: count:= 0:
    p:= 3:
    for i from 2 while count < 100 do
      q:= p; p:= nextprime(p);
      if isprime((p-q)/2) then R:= R,i; count:= count+1 fi
    od:
    R; # Robert Israel, Sep 27 2023
  • Mathematica
    Flatten[Position[(#[[2]]-#[[1]])/2&/@Partition[Prime[Range[200]],2,1],?PrimeQ]] (* _Harvey P. Dale, Dec 14 2012 *)
  • PARI
    f(n) = for(x=1,n,y=prime(x+1)-prime(x);if(isprime(y\2),print1(x",")))