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.
%I A084704 #32 Jan 05 2018 15:15:49 %S A084704 7,17,19,23,61,29,43,59,53,43,97,53,79,59,89,83,73,79,107,181,127,131, %T A084704 113,109,113,151,167,193,149,151,167,197,163,197,163,229,199,179,281, %U A084704 347,241,263,229,257,223,271,331,239,313,269,263,313,263,269,359,293 %N A084704 Smallest prime p > prime(n) such that (p + prime(n))/2 is prime. %C A084704 Subsidiary sequences: (1) Sequence of primes for a given prime p such that (p+q)/2 is a prime iff q belongs to this sequence. For example, for p = 5 the sequence is 17, 29, 41, 53, 89,... %C A084704 Note that actually a(n) > prime(n+1) in all cases - because there is no prime between prime(n) and prime(n+1). - _Zak Seidov_, Jul 24 2013. %C A084704 For n>2, a(n)-prime(n) is a multiple of 12. - _Zak Seidov_, Oct 15 2015 %C A084704 [Proof: the sequence searches prime triples prime(n)<q<a(n) such that q-prime(n)=a(n)-q, so q is the arithmetic mean of prime(n) and a(n). Seidov's theorem means that q-prime(n) and a(n)-q are multiples of 6 and cannot be multiples of 2 or 4 or 8 or 10 or 14 or 16 or 20 etc. The absence of such prime constellations (p,p+g,p+2g) with g=2, 4, 8, 10, etc is a fact proved by considering the prime triples modulo 3. - _R. J. Mathar_, Oct 16 2015] %H A084704 T. D. Noe and Zak Seidov, <a href="/A084704/b084704.txt">Table of n, a(n) for n = 2..10000</a> %p A084704 A084704 := proc(n) %p A084704 local p,a,q ; %p A084704 p := ithprime(n) ; %p A084704 a := nextprime(p) ; %p A084704 while not isprime((a+p)/2) do %p A084704 a := nextprime(a) ; %p A084704 end do: %p A084704 return a; %p A084704 end proc: # _R. J. Mathar_, Oct 16 2015 %t A084704 Table[p = q = Prime[n]; While[q = NextPrime[q]; ! PrimeQ[(p + q)/2]]; q, {n, 2, 100}] (* _T. D. Noe_, Apr 20 2011 *) %t A084704 p=2; Table[p=NextPrime[p]; q=NextPrime[p,2]; While[!PrimeQ[(p+q)/2], q=NextPrime[q]]; q, {99}] (* _Zak Seidov_, Jul 24 2013 *) %o A084704 (PARI) a(n) = {q = prime(n); p = nextprime(q+1); while (!isprime((q+p)/2), p = nextprime(p+1)); p;} \\ _Michel Marcus_, Oct 15 2015 %Y A084704 Cf. A001358, A165138. %K A084704 nonn %O A084704 2,1 %A A084704 _Amarnath Murthy_, Jun 08 2003 %E A084704 More terms from _David Wasserman_, Jan 03 2005