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.

Previous Showing 21-24 of 24 results.

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))}

A103709 Smallest prime p such that both p +/- 2n are primes closest to p, or zero if no such prime exists.

Original entry on oeis.org

5, 0, 53, 0, 0, 211, 0, 0, 20201, 0, 0, 16787, 0, 0, 69623, 0, 0, 255803, 0, 0, 247141, 0, 0, 3565979, 0, 0, 6314447, 0, 0, 4911311, 0, 0, 12012743, 0, 0, 23346809, 0, 0, 43607429, 0, 0, 34346287, 0, 0, 36598607, 0, 0, 51042053, 0, 0, 460475569, 0, 0
Offset: 1

Views

Author

Zak Seidov, Feb 12 2005

Keywords

Comments

Such triples of primes occur only for n divisible by 3 (except for the first term with n=1).

Examples

			a(36)=23346809 because 23346809-72, 23346809 and 23346809+72 are three successive primes and 23346809 is the least such prime.
		

Crossrefs

Formula

p-2n, p and p+2n are three successive primes and p is the least such prime.

Extensions

More terms from Robert G. Wilson v, Feb 22 2005
Definition, Formula, and Example clarified by Jonathan Sondow, Oct 27 2017

A163768 Distance of Fibonacci(n) to the closest prime which is not Fibonacci(n) itself.

Original entry on oeis.org

2, 1, 1, 1, 1, 2, 1, 2, 2, 3, 2, 6, 5, 4, 2, 3, 4, 4, 5, 4, 2, 3, 2, 4, 13, 4, 10, 11, 14, 10, 23, 4, 4, 9, 10, 14, 11, 6, 12, 3, 2, 6, 7, 12, 16, 9, 24, 6, 5, 20, 18, 23, 14, 6, 9, 12, 10, 21, 4, 30, 13, 38, 4, 7, 16, 12, 19, 36, 22, 31, 4, 32, 11, 12, 60, 7, 2, 6, 27, 12, 62, 25, 20, 6, 19, 78
Offset: 0

Views

Author

Jonathan Vos Post, Aug 04 2009

Keywords

Comments

The closest prime to F(n) -- next closest if F(n) itself is prime -- for n = 0, 1, 2, 3, 4, ...:
2, 2, 2, 3, 2, 3 or 7, 7, 11, 19 or 23, 31 or 37, 53, 83, 139 or 149, 229, 379, 607 or 613.

Examples

			a(0) = 2 because 2 is the closest prime to F(0) = 0, and 2-0 = 2.
a(1) = 1 because 2 is the closest prime to F(1) = 1, and 2-1 = 1.
a(3) = 1 because 3 is the closest prime to F(3) = 2 other than the prime F(3) = 2 itself, and 3-2 = 1.
		

Crossrefs

Programs

  • Maple
    A051700 := proc(n) if n < 2 then 2-n; elif n = 2 then 1 ; else min( nextprime(n)-n, n-prevprime(n) ); fi; end:
    A000045 := proc(n) combinat[fibonacci](n) ; end:
    A163768 := proc(n) A051700(A000045(n)) ; end: seq(A163768(n), n=0..100) ; # R. J. Mathar, Aug 06 2009
  • Mathematica
    g[n_]:=Module[{fn=Fibonacci[n],a,b},a=NextPrime[fn,-1];b=NextPrime[fn];Min[Abs[fn-a],Abs[b-fn]]]; Table[g[i],{i,0,100}] (* Harvey P. Dale, Jan 15 2011 *)

Formula

For n not in A001605: a(n) = MIN{|A000045(n) - A000040(i)} = A079677(n).
For n in A001605: a(n) = MIN{k such that k > 0 and |A000045(n) - A000040(i)| = k}.
a(n) = A051700(A000045(n)). - R. J. Mathar, Aug 06 2009

Extensions

More terms from R. J. Mathar, Aug 06 2009, reformatted Aug 29 2009

A268270 Least prime that is at distance > n from the nearest squarefree number.

Original entry on oeis.org

2, 17, 727, 47527, 29002021, 494501773, 44633461423, 7489886099881
Offset: 0

Views

Author

Keywords

Examples

			a(0)=2 is the least prime and it is at distance 1 from the nearest squarefree numbers (1 and/or 3).
a(1)=17 is the least prime that has no squarefree neighbor: both 16 and 18 are divisible by a square; the nearest squarefree numbers, 15 and 19, are both at distance 2.
a(2)=727 is the least prime p such that p-2 and p+1 are (two consecutive terms) in A068781, namely A068781(75..76).
a(3)=47527 is the least prime p such that p-3 and p+1 are (two consecutive terms) in A070258, namely A070258(878..879).
a(4)=29002021 is the least prime p such that p-4 and p+1 are (two consecutive terms) in A070284.
a(5)=494501773 is the least prime p such that p-5 and p+1 are (two consecutive terms) in A078144.
Similarly, for n = 6, 7, 8 and 9, a(n) is the least prime p such that p-n and p+1 are (two consecutive terms) in A049535, A077640, A077647 and A078143, respectively.
		

Crossrefs

Programs

  • PARI
    a(n)=forprime(p=n,,for(s=1,n,(issquarefree(p-s)||issquarefree(p+s)) && next(2)); return(p))

Extensions

a(4) corrected and a(5) computed by Christopher E. Thompson, Jan 20 2016
a(6)-a(7) from Bert Dobbelaere, Jan 28 2019
Previous Showing 21-24 of 24 results.