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!)
A163847 Starting from a(1)=13, a(n+1) is the smallest prime > a(n) such that 2*a(n) - a(n+1) is also prime. 6

%I #21 Aug 09 2023 13:25:14

%S 13,19,31,43,67,73,79,97,127,151,163,199,241,271,313,349,367,397,421,

%T 433,457,541,619,631,643,673,727,811,853,877,967,997,1087,1123,1129,

%U 1171,1213,1297,1303,1327,1423,1447,1471,1483,1543,1597,1627,1657,1693

%N Starting from a(1)=13, a(n+1) is the smallest prime > a(n) such that 2*a(n) - a(n+1) is also prime.

%C This is: select the prime a(n+1) = a(n)+d such that at a(n)-d is another prime at the same distance to but at the opposite side of a(n).

%C It seems all these primes are in the class 1 (mod 6), that is, in A002476 as opposed to A007528.

%H Zhi-Wei Sun, <a href="/A163847/b163847.txt">Table of n, a(n) for n = 1..10000</a>

%H Zhi-Wei Sun, <a href="http://arxiv.org/abs/1211.1588">Conjectures involving primes and quadratic forms</a>, arXiv:1211.1588.

%e For a(2), the first candidate is the prime 17=13+4, which is not selected because 13-4=9 is not prime.

%e The next larger candidate is the prime 13+6=19, which is selected as a(2) because 13-6=7 is also prime.

%e For a(3) the first candidate is the prime 19+4=23, which is not selected because 19-4=15 is not prime.

%e The next candidate is the prime 19+10=29, which is not selected because the 19-10=9 is not prime.

%e The next larger candidate, the prime 19+12=31 is selected as a(3), because 19-12=7 is prime.

%p A163847 := proc(n) option remember; if n = 1 then 13; else for a from procname(n-1)+2 by 2 do if isprime(a) and isprime( 2*procname(n-1)-a) then RETURN(a) ; fi; od: fi; end:

%p seq(A163847(n),n=1..80) ; # _R. J. Mathar_, Aug 29 2009

%t DeltaPrimePrevNext[n_]:=Module[{d, k1, k2}, k1=n-1; k2=n+1; While[ !PrimeQ[k1] || !PrimeQ[k2], k2++; k1-- ]; d=k2-n]; lst13={}; p=13; Do[If[p-DeltaPrimePrevNext[p]>1, AppendTo[lst13, p]; p=p+DeltaPrimePrevNext[p]],{n, 7!}]; lst13

%t (* Second program: *)

%t k=6

%t n=1

%t Do[If[m==6, Print[n, " ", 13]]; If[m==k, n=n+1; Do[If[PrimeQ[2Prime[m]-Prime[j]]==True, k=j; Print[n, " ", Prime[j]]; Goto[aa]], {j, m+1, PrimePi[2Prime[m]]}]]; Label[aa]; Continue, {m, 6, 1000}] (* _Zhi-Wei Sun_, Feb 25 2013 *)

%t sp[p_]:=Module[{p1=NextPrime[p]},While[!PrimeQ[2p-p1],p1=NextPrime[p1]];p1]; NestList[ sp,13,50] (* _Harvey P. Dale_, Aug 09 2023 *)

%o (PARI) first(n) = { my(res = vector(n)); res[1] = 13; for(x=2, n, forprime(p=res[x-1]+1, , if(ispseudoprime(2*res[x-1] - p), res[x]=p; break()))); res; } \\ _Iain Fox_, Nov 18 2017

%Y Cf. A163846, A222532.

%K nonn

%O 1,1

%A _Vladimir Joseph Stephan Orlovsky_, Aug 05 2009

%E Definition and comment rephrased by _R. J. Mathar_, Aug 29 2009

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 20 07:43 EDT 2024. Contains 371799 sequences. (Running on oeis4.)