login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A087711 a(n) = smallest number k such that both k-n and k+n are primes. 10

%I #35 Sep 08 2022 08:45:11

%S 2,4,5,8,7,8,11,10,11,14,13,18,17,16,17,22,21,20,23,22,23,26,25,30,29,

%T 28,33,32,31,32,37,36,35,38,37,38,43,42,41,44,43,48,47,46,57,52,51,50,

%U 53,52,53,56,55,56,59,58,75,70,69,72,67,66,65,68,67,72,71,70,71,80,81,78

%N a(n) = smallest number k such that both k-n and k+n are primes.

%C Let b(n), c(n) and d(n) be respectively, smallest number m such that phi(m-n) + sigma(m+n) = 2n, smallest number m such that phi(m+n) + sigma(m-n) = 2n and smallest number m such that phi(m-n) + sigma(m+n) = phi(m+n) + sigma(m-n), we conjecture that for each positive integer n, a(n)=b(n)=c(n)=d(n). Namely we conjecture that for each positive integer n, a(n) < A244446(n), a(n) < A244447(n) and a(n) < A244448(n). - _Jahangeer Kholdi_ and _Farideh Firoozbakht_, Sep 05 2014

%H Zak Seidov, <a href="/A087711/b087711.txt">Table of n, a(n) for n = 0..1000</a>

%F a(n) = A020483(n)+n for n >= 1. - _Robert Israel_, Sep 08 2014

%e n=10: k=13 because 13-10 and 13+10 are both prime and 13 is the smallest k such that k +/- 10 are both prime

%e 4-1=3, prime, 4+1=5, prime; 5-2=3, 5+2=7; 8-3=5, 8+3=11; 9-4=5, 9+4=13, ...

%p Primes:= select(isprime,{seq(2*i+1,i=1..10^3)}):

%p a[0]:= 2:

%p for n from 1 do

%p Q:= Primes intersect map(t -> t-2*n,Primes);

%p if nops(Q) = 0 then break fi;

%p a[n]:= min(Q) + n;

%p od:

%p seq(a[i],i=0..n-1); # _Robert Israel_, Sep 08 2014

%t s = ""; k = 0; For[i = 3, i < 22^2, If[PrimeQ[i - k] && PrimeQ[i + k], s = s <> ToString[i] <> ","; k++ ]; i++ ]; Print[s] (* _Vladimir Joseph Stephan Orlovsky_, Apr 03 2008 *)

%t snk[n_]:=Module[{k=n+1},While[!PrimeQ[k+n]||!PrimeQ[k-n],k++];k]; Array[ snk,80,0] (* _Harvey P. Dale_, Dec 13 2020 *)

%o (Magma) distance:=function(n); k:=n+2; while not IsPrime(k-n) or not IsPrime(k+n) do k:=k+1; end while; return k; end function; [ distance(n): n in [1..71] ]; /* _Klaus Brockhaus_, Apr 08 2007 */

%o (PARI) a(n)=my(k);while(!isprime(k-n) || !isprime(k+n),k++);return(k) \\ _Edward Jiang_, Sep 05 2014

%Y Cf. A087695, A087696, A087697, A087678, A087679, A087680, A087681, A087682, A087683.

%Y Cf. A082467. See A137169 for another version.

%Y Cf. A244446, A244447, A244448.

%Y Cf. A020483.

%K easy,nonn

%O 0,1

%A _Zak Seidov_, Sep 28 2003

%E Entries checked by _Klaus Brockhaus_, Apr 08 2007

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 08:27 EDT 2024. Contains 371964 sequences. (Running on oeis4.)