A163846 Starting from a(1)=5, a(n+1) is the smallest prime > a(n) such that 2*a(n)-a(n+1) is also prime.
5, 7, 11, 17, 23, 29, 41, 53, 59, 71, 83, 107, 113, 137, 167, 197, 227, 257, 263, 269, 281, 293, 317, 353, 359, 401, 419, 449, 467, 491, 503, 557, 593, 599, 641, 683, 719, 761, 821, 881, 941, 953, 977, 983, 1013, 1049, 1151, 1193, 1223, 1229, 1277, 1361, 1433
Offset: 1
Keywords
Examples
The first candidate for a(2) is the prime 5+2=7, which is selected since 5-2=3 is also prime. The first candidate for a(3) is the prime 7+4=11, which is selected since 7-4=3 is also prime. The first candidate for a(4) is the prime 11+2=13, which is not selected since 11-2=9 is composite. The second candidate for a(4) is the prime 11+4=17, which is selected since 11-4=7 is prime.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Zhi-Wei Sun, Conjectures involving primes and quadratic forms, arXiv:1211.1588.
Programs
-
Mathematica
DeltaPrimePrevNext[n_]:=Module[{d, k1, k2}, k1=n-1; k2=n+1; While[ !PrimeQ[k1] || !PrimeQ[k2], k2++; k1-- ]; d=k2-n]; lst={}; p=5; Do[If[p-DeltaPrimePrevNext[p]>1, AppendTo[lst, p]; p=p+DeltaPrimePrevNext[p]], {n,6!}]; lst k=3 n=1 Do[If[m==3, Print[n, " ", 5]]; 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, 3, 1000}] (* Zhi-Wei Sun, Feb 25 2013 *) np[n_]:=Module[{nxt=NextPrime[n]},While[!PrimeQ[2n-nxt],nxt=NextPrime[nxt]]; nxt]; NestList[np, 5, 60] (* Harvey P. Dale, Feb 28 2013 *)
Extensions
Edited by R. J. Mathar, Aug 29 2009
Comments