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.

This page as a plain text file.
%I A098015 #12 Sep 27 2023 10:45:52
%S A098015 4,6,8,9,11,12,14,15,16,18,19,21,22,23,25,27,29,30,31,32,34,36,37,38,
%T A098015 39,40,42,44,48,50,51,53,54,55,56,58,59,61,62,63,65,66,67,68,70,71,73,
%U A098015 74,75,76,78,80,82,84,85,86,88,90,93,95,96,100,101,102,103,105,106,107,108
%N A098015 Indices x such that (1/2)(prime(x+1) - prime(x)) is prime.
%H A098015 Robert Israel, <a href="/A098015/b098015.txt">Table of n, a(n) for n = 1..10000</a>
%e A098015 Difference between prime(4) and prime(4+1) = 4. 1/2(4) = 2. So 4 is first entry in the table.
%p A098015 R:= NULL: count:= 0:
%p A098015 p:= 3:
%p A098015 for i from 2 while count < 100 do
%p A098015   q:= p; p:= nextprime(p);
%p A098015   if isprime((p-q)/2) then R:= R,i; count:= count+1 fi
%p A098015 od:
%p A098015 R; # _Robert Israel_, Sep 27 2023
%t A098015 Flatten[Position[(#[[2]]-#[[1]])/2&/@Partition[Prime[Range[200]],2,1],_?PrimeQ]] (* _Harvey P. Dale_, Dec 14 2012 *)
%o A098015 (PARI) f(n) = for(x=1,n,y=prime(x+1)-prime(x);if(isprime(y\2),print1(x",")))
%K A098015 easy,nonn
%O A098015 1,1
%A A098015 _Cino Hilliard_, Sep 09 2004