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.

A078496 Smallest prime p such that p>n and 2*n-p is also prime.

This page as a plain text file.
%I A078496 #14 Jan 01 2024 02:00:18
%S A078496 5,7,7,11,11,11,13,17,13,19,17,17,19,23,19,31,23,23,31,29,29,31,29,31,
%T A078496 37,41,31,43,41,37,37,41,41,43,47,41,43,53,43,67,47,47,61,53,53,61,53,
%U A078496 59,61,59,61,67,59,61,73,71,61,79,71,67,67,71,71,73,83,71,73,83,73,79
%N A078496 Smallest prime p such that p>n and 2*n-p is also prime.
%C A078496 Suggested by Goldbach Conjecture.
%C A078496 Values of q from A143697. This follows from the factorization n^2-k^2 = (n-k)(n+k).
%H A078496 P. CAMI, <a href="/A078496/b078496.txt">Table of n, a(n) for n = 4..60000</a>
%F A078496 n>3 integer; a(n)=min{p: p>n; p, 2*n-p are primes}.
%e A078496 a(11)=17.
%t A078496 Table[p=n+1; q=2n-p; While[q>0&&!(PrimeQ[p]&&PrimeQ[q]), p++; q-- ]; p, {n, 4, 100}]
%o A078496 (PARI) a(n) = {my(p=nextprime(n+1)); while(!isprime(2*n-p), p = nextprime(p+1)); p;} \\ _Michel Marcus_, Oct 22 2016
%Y A078496 Cf. A143697, A078587.
%Y A078496 a(n) = 2n - A078587(n).
%Y A078496 Cf. A082467
%K A078496 nonn
%O A078496 4,1
%A A078496 Serhat Sevki Dincer (sevki(AT)ug.bilkent.edu.tr), Nov 26 2002
%E A078496 Edited by _N. J. A. Sloane_, Jan 24 2009 at the suggestion of _R. J. Mathar_ and _T. D. Noe_.