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.

Showing 1-3 of 3 results.

A120937 Least prime such that the distance to the two adjacent primes is 2n or greater.

Original entry on oeis.org

3, 5, 23, 53, 211, 211, 211, 1847, 2179, 2179, 3967, 16033, 16033, 24281, 24281, 24281, 38501, 38501, 38501, 38501, 38501, 58831, 203713, 206699, 206699, 413353, 413353, 413353, 1272749, 1272749, 1272749, 1272749, 2198981, 2198981, 2198981
Offset: 0

Views

Author

T. D. Noe, Jul 21 2006

Keywords

Comments

Erdos and Suranyi call these reclusive primes and prove that such a prime exists for all n. Except for a(0), the record values are in A023186.

Examples

			a(3)=53 because the adjacent primes 47 and 59 are at distance 6 and all smaller primes have a closer distance.
		

References

  • Paul ErdÅ‘s and Janos Suranyi, Topics in the theory of numbers, Springer, 2003.

Crossrefs

Programs

  • Mathematica
    k=2; Table[While[Prime[k]-Prime[k-1]<2n || Prime[k+1]-Prime[k]<2n, k++ ]; Prime[k], {n,0,40}]

A268343 Hermit primes: primes which are not a nearest neighbor of another prime.

Original entry on oeis.org

23, 37, 53, 67, 89, 97, 113, 157, 173, 211, 233, 277, 293, 307, 317, 359, 389, 409, 449, 457, 467, 479, 509, 577, 607, 631, 653, 691, 719, 751, 839, 853, 863, 877, 887, 919, 929, 1039, 1069, 1087, 1201, 1223, 1237, 1283, 1297, 1307, 1327, 1381, 1423, 1439
Offset: 1

Views

Author

Karl W. Heuer, Feb 02 2016

Keywords

Comments

If p is a balanced prime (A006562), with two nearest neighbors, then it eliminates both of those neighbors from being hermits.
Conjecture: the asymptotic probability of a prime being in this list is 1/4.
A subsequence of the isolated primes A007510. The sequence of lonely primes A087770 appears to be a subsequence, except for its first three terms (2, 3 and 7). (This would not be true if one of these were followed by two increasingly larger gaps.) - M. F. Hasler, Mar 15 2016

Examples

			53 is in the list because the previous prime, 47, is closer to 43 than to 53, and the following prime, 59, is closer to 61 than to 53.
		

Crossrefs

Cf. A269734 (number of hermit primes <= prime(n)).

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    pr:= select(isprime, [$2 .. nextprime(nextprime(N))]):
    Np:= nops(pr):
    ishermit:= Vector(Np,1):
    d:= pr[3..Np] + pr[1..Np-2] - 2*pr[2..Np-1]:
    for i from 1 to Np-2 do
      if d[i] > 0 then ishermit[i]:= 0
    elif d[i] < 0 then ishermit[i+2]:= 0
    else ishermit[i]:= 0; ishermit[i+2]:= 0
    fi
    od:
    subs(0=NULL, zip(`*`, pr[1..Np-2],convert(ishermit,list))); # Robert Israel, Mar 09 2016
  • Mathematica
    Select[Prime@ Range@ 228, Function[n, AllTrue[{Subtract @@ Take[#, 2], Subtract @@ Reverse@ Take[#, -2]} &@ Differences[NextPrime[n, #] & /@ {-2, -1, 0, 1, 2}], # < 0 &]]] (* Michael De Vlieger, Feb 02 2016, Version 10 *)
  • PARI
    A268343_list(LIM=1500)={my(d=vector(4),i,o,L=List());forprime(p=1,LIM,(d[i++%4+1]=-o+o=p)d[(i-3)%4+1]&&listput(L,p-d[i%4+1]-d[(i-1)%4+1]));Vec(L)} \\ M. F. Hasler, Mar 15 2016
    
  • PARI
    is_A268343(n,p=precprime(n-1))={n-p>p-precprime(p-1)&&(p=nextprime(n+1))-n>nextprime(p+1)-p&&isprime(n)} \\ M. F. Hasler, Mar 15 2016

Extensions

Deleted my incorrect conjecture about asymptotic behavior. - N. J. A. Sloane, Mar 10 2016

A096265 Aloof primes: Total distance between prime and neighboring primes sets record.

Original entry on oeis.org

2, 3, 5, 7, 23, 53, 89, 113, 211, 1129, 1327, 2179, 2503, 5623, 9587, 14107, 19609, 19661, 31397, 31469, 38501, 58831, 155921, 360749, 370261, 396833, 1357201, 1561919, 4652353, 8917523, 20831323, 38089277, 70396393, 72546283, 102765683
Offset: 1

Views

Author

Rick L. Shepherd, Jun 21 2004

Keywords

Examples

			a(1) = 2 as 2 has only one prime neighbor, 3 and 3-2 = 1, the first possible record. a(2) = 3 because the sum of the distances (gaps) from 3 to its two neighboring primes is 3-2 + 5-3 = 3 > 1, beating the previous record. a(5) = 23 because 23, with 29-19 = 10, is the smallest prime beating a(4) = 7's 11-5 = 6.
		

Crossrefs

Cf. A031132 (record distances corresponding to a(2) onward), A023186 (lonely primes), A087770 (lonely primes, another definition).

Programs

  • Mathematica
    PrimeNextDelta[n_]:=(Do[If[PrimeQ[n+k], a=n+k; d=a-n; Break[]], {k, 9!}]; d); PrimePrevDelta[n_]:=(Do[If[PrimeQ[n-k], a=n-k; d=n-a; Break[]], {k, n}]; d); q=0; lst={2}; Do[p=Prime[n]; d1=PrimeNextDelta[p]; d2=PrimePrevDelta[p]; d=d1+d2; If[d>q, AppendTo[lst, p]; q=d], {n, 2, 10^4}]; lst (* Vladimir Joseph Stephan Orlovsky, Aug 07 2008 *)
     Join[{2},DeleteDuplicates[{#[[2]],#[[3]]-#[[1]]}&/@Partition[Prime[Range[6 10^6]],3,1],GreaterEqual[#1[[2]],#2[[2]]]&][[All,1]]] (* Harvey P. Dale, Jul 05 2022 *)
  • PARI
    /* 436272953 is the next-to-the-largest precalculated prime */
    /* with which PARI/GP (Version 2.0.17 (beta) at least) can be started */
    /* A different program would be required to go beyond a(37)=325737821 */
    {r=0; print1("2,"); forprime(p=3,436272953,
    s=nextprime(p+1)-precprime(p-1); if(s>r, print1(p,","); r=s))}
Showing 1-3 of 3 results.