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 81-90 of 150 results. Next

A066875 Numbers k such that prime(k+1) + prime(k-1) = 2*prime(k).

Original entry on oeis.org

3, 16, 37, 40, 47, 55, 56, 74, 103, 108, 111, 119, 130, 161, 165, 185, 188, 195, 200, 219, 240, 272, 273, 292, 340, 359, 388, 420, 427, 465, 466, 509, 521, 554, 600, 606, 622, 630, 634, 668, 683, 684, 703, 710, 711, 734, 762, 792, 814, 822, 823, 830, 831, 883
Offset: 1

Views

Author

Benoit Cloitre, Jan 21 2002

Keywords

Comments

The indices of primes that are equidistant from the two primes surrounding them. - Harvey P. Dale, May 16 2013
Indices of balanced primes (A006562). - Zak Seidov, Mar 03 2019

Crossrefs

Cf. A000720 (primepi), A006562 (balanced primes).

Programs

  • Magma
    [n: n in [2..1000] | 2*NthPrime(n) eq (NthPrime(n-1) + NthPrime(n+1))]; // Vincenzo Librandi, Apr 09 2015
  • Mathematica
    Select[Range[2, 1000], Prime[ # ] == (Prime[ # + 1] + Prime[ # - 1])/2 &] (* Ray Chandler, Jan 09 2007 *)
    PrimePi/@Transpose[Select[Partition[Prime[Range[900]],3,1],Length[ Union[ Differences[ #]]]==1&]][[2]] (* Harvey P. Dale, May 16 2013 *)
  • PARI
    isok(k) = { k > 1 && prime(k+1) + prime(k-1) == 2*prime(k) } \\ Harry J. Smith, Apr 03 2010
    

Formula

a(n) = primepi(A006562(n)) = A000720(A006562(n)).

Extensions

Corrected by Ray Chandler, Jan 09 2007

A089344 Smallest prime(k) such that prime(k)-prime(k-n) is equal to prime(k+1)-prime(k).

Original entry on oeis.org

5, 7, 619, 6581, 13933, 15823, 22307, 259033, 678659, 745757, 576791, 15014557, 35630467, 31515413, 264426203, 356604959, 364058659, 2529682091, 6868844179, 1457908691, 12799238129, 23294528897, 72106293983, 82160403553, 230966323927, 19187736221
Offset: 1

Views

Author

Amarnath Murthy, Nov 05 2003

Keywords

Examples

			a(4) = 6581, the next prime is 6599, 6599-6581 = 18, the four previous primes are 6563, 6569, 6571 and 6577. 6581-6563 = 18.
		

Crossrefs

Cf. A066496, A006562 (balanced primes), A117876, A118467.

Programs

  • Mathematica
    f[n_] := Block[{k = n + 1}, While[ 2Prime[k] != Prime[k + 1] + Prime[k - n], k++ ]; Prime[k]]; Table[ f[n], {n, 17}] (* Robert G. Wilson v, Nov 11 2003 *)

Formula

a(n) = prime(A066496(n)). - Giovanni Resta, Apr 04 2017

Extensions

Corrected and extended by Ray Chandler and Robert G. Wilson v, Nov 07 2003
a(18)-a(21) from Fabien Sibenaler, Mar 15 2013
a(22)-a(26) from Giovanni Resta, Apr 04 2017

A102552 a(n) = prime(n) - (prime(n+1) + prime(n-1))/2.

Original entry on oeis.org

0, -1, 1, -1, 1, -1, -1, 2, -2, 1, 1, -1, -1, 0, 2, -2, 1, 1, -2, 1, -1, -1, 2, 1, -1, 1, -1, -5, 5, -1, 2, -4, 4, -2, 0, 1, -1, 0, 2, -4, 4, -1, 1, -5, 0, 4, 1, -1, -1, 2, -4, 2, 0, 0, 2, -2, 1, 1, -4, -2, 5, 1, -1, -5, 4, -2, 4, -1, -1, -1, 1, 0, 1, -1, -1, 2, -2, -1, 4, -4, 4, -2, 1, -1, -1, 2, 1, -1, -4, 2, 2, -2, 2, -1, -3, 5, -8, 6, -2, 2, 0, 2, -2
Offset: 3

Views

Author

Yasutoshi Kohmoto, Feb 25 2005

Keywords

Examples

			a(6)=-1 because 13-(17+11)/2=-1.
		

References

  • Eric Weisstein, CRC Concise Encyclopedia of Mathematics, 1998, page 1321.

Crossrefs

Programs

  • Magma
    A102552:= func< n | (2*NthPrime(n)-NthPrime(n+1)-NthPrime(n-1))/2 >;
    [A102552(n): n in [3..120]]; // G. C. Greubel, Feb 02 2025
  • Maple
    a:=n->ithprime(n)-(ithprime(n+1)+ithprime(n-1))/2: seq(a(n),n=3..95); # Emeric Deutsch, Mar 02 2005
  • Mathematica
    f[n_] := Prime[n] - (Prime[n - 1] + Prime[n + 1])/2; Table[f[n], {n, 3, 107}] (* Robert G. Wilson v, Sep 25 2006 *)
    #[[2]]-(#[[1]]+#[[3]])/2&/@Partition[Prime[Range[2,110]],3,1] (* Harvey P. Dale, Sep 21 2013 *)
  • PARI
    a(n) = prime(n)-(prime(n+1)+prime(n-1))/2;
    vector(100,n,a(n+2)) \\ Joerg Arndt, Jan 20 2015
    
  • Python
    from sympy import sieve as p
    def A102552(n): return p[n]-(p[n+1]+p[n-1])//2 # Karl-Heinz Hofmann, May 22 2024
    

Formula

a(n) = (1/2)*(A001223(n) - A001223(n+1)).
a(n) = -A036263(n-1)/2. - T. D. Noe, Oct 06 2006 [corrected by Georg Fischer, Oct 19 2023]

Extensions

More terms from Emeric Deutsch, Mar 02 2005

A117217 Common prime gap associated with the primes A122535.

Original entry on oeis.org

2, 6, 6, 6, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 12, 6, 6, 6, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 12, 6, 6, 6, 6, 6, 12, 6, 6, 6, 6, 12, 12, 6, 12, 6, 6, 6, 6, 6, 6, 6, 6, 12, 6, 6, 6, 6, 6, 6, 6, 6, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6
Offset: 1

Views

Author

Lekraj Beedassy, Mar 04 2006

Keywords

Crossrefs

Cf. A006562, A013632, A122535. - Zak Seidov, Feb 12 2013

Formula

a(n)=A013632(A122535(n)). - R. J. Mathar, Apr 11 2008
a(n)=A006562(n)-A122535(n). - Zak Seidov, Feb 12 2013

Extensions

Corrected and extended by R. J. Mathar, Apr 11 2008

A126558 Arithmetic mean of two consecutive prime interprimes of third order: interprimes of fourth order.

Original entry on oeis.org

199532, 329070, 487630, 664345, 878455, 974874, 1030434, 1183684, 1329780, 1453746, 1550775, 1568843, 1573919, 1618431, 1693333, 1829142, 2087087, 2262462, 2348799, 2438192, 2811665, 3436775, 3900917, 4270580, 4830665
Offset: 1

Views

Author

Artur Jasinski, Dec 27 2006

Keywords

Comments

For primes in this sequence (prime interprimes of fourth order) see A127364.

Crossrefs

Cf. A006562 (balanced primes), A024675 (interprimes), A126554 (interprimes of second order), A126555 (prime interprimes of second order), A126556 (interprimes of third order), A126557 (prime interprimes of third order).

Programs

  • PARI
    {m=5000000;a=0;g=0;e=0;p=2;q=3;r=5;while(r<=m,if((p+r)/2==q,if(a>0,b=(a+q)/2;if(isprime(b),if(g>0,h=(g+b)/2;if(isprime(h),if(e>0,f=(e+h)/2;print1(f,","));e=h));g=b));a=q);p=q;q=r;r=nextprime(r+1))} \\ Klaus Brockhaus, Jan 11 2007

Formula

a(n) = (A126557(n)+A126557(n+1))/2.

Extensions

Edited and extended by Klaus Brockhaus, Jan 11 2007

A129190 Primes q such that p = (r+q+s-1)/2 is a balanced prime, where r, q, s are consecutive primes.

Original entry on oeis.org

397, 1277, 2939, 4217, 10211, 11657, 13049, 17117, 17791, 19507, 23117, 25913, 31259, 36523, 42677, 44777, 45659, 49711, 54499, 56701, 63521, 64283, 73877, 74573, 85093, 88609, 89477, 89759, 90059, 93563, 104161, 104831, 106937, 108179
Offset: 1

Views

Author

Klaus Brockhaus, Apr 05 2007

Keywords

Comments

The primes p arising here are in A129191.
q need not be a balanced prime, see however A129241.

Examples

			389, 397, 401 are consecutive primes. 593 = (389+397+401-1)/2 = A006562(10) is a balanced prime, it is the average of the preceding prime 587 and the next prime 599. Hence 397 is a term.
		

Crossrefs

Cf. A006562 (balanced primes), A127313, A129191, A129241.

Programs

  • Magma
    [ q: q in PrimesInInterval(3, 110000) | IsPrime(p) and PreviousPrime(p)+NextPrime(p) eq 2*p where p is (PreviousPrime(q)+q+NextPrime(q)-1) div 2 ];
  • Mathematica
    bpQ[{r_,q_,s_}]:=Module[{p=(r+q+s-1)/2},PrimeQ[p]&&Mean[{NextPrime[p],NextPrime[p,-1]}]==p]; Select[Partition[Prime[Range[ 11000]],3,1],bpQ][[;;,2]] (* Harvey P. Dale, Oct 10 2024 *)

A129191 Balanced primes p of the form (r+q+s-1)/2, where r, q, s are consecutive primes.

Original entry on oeis.org

593, 1907, 4409, 6323, 15313, 17483, 19577, 25673, 26693, 29269, 34673, 38867, 46889, 54773, 64013, 67169, 68483, 74567, 81749, 85049, 95273, 96431, 110813, 111863, 127643, 132929, 134213, 134639, 135089, 140351, 156241, 157253, 160403
Offset: 1

Views

Author

Klaus Brockhaus, Apr 05 2007

Keywords

Comments

The primes q arising here are in A129190.
q need not be a balanced prime, see however A129242.

Examples

			1907 = (1259+1277+1279-1)/2 is prime and 1259, 1277, 1279 are consecutive primes. 1907 = A006562(24) is a balanced prime, it has distance 6 to the preceding prime 1901 and to the next prime 1913. Hence 1907 is a term.
		

Crossrefs

Cf. A006562 (balanced primes), A127313, A129190, A129242.

Programs

  • Magma
    [ p: q in PrimesInInterval(3, 110000) | IsPrime(p) and PreviousPrime(p)+NextPrime(p) eq 2*p where p is (PreviousPrime(q)+q+NextPrime(q)-1) div 2];
  • Maple
    p:= 2: q:= 3: r:= 5:
    Res:= NULL: count:= 0:
    while count < 100 do
      p:= q; q:= r; r:= nextprime(r);
      s:= (p+q+r-1)/2;
      if isprime(s) and nextprime(s) + prevprime(s) = 2*s then
        count:= count+1; Res:= Res, s;
      fi
    od:
    Res; # Robert Israel, May 03 2019

A173892 Numbers k such that k and k+6 are both balanced primes.

Original entry on oeis.org

257, 1747, 3307, 5107, 5387, 6317, 6367, 12647, 13457, 14747, 15797, 15907, 17477, 18217, 19477, 23327, 26177, 30097, 30637, 53617, 56087, 62207, 63697, 71347, 75527, 77557, 78797, 80917, 82787, 83437, 84437, 89107, 89387, 91297, 94427, 95267
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Mar 01 2010

Keywords

Comments

k-6, k, k+6, and k+12 are consecutive primes.

Crossrefs

Cf. A006562.
Cf. A054801. [From R. J. Mathar, Mar 29 2010]

Formula

a(n) = A033451(n) + 6.

Extensions

Corrected and rewritten by Charles R Greathouse IV, Mar 19 2010

A184248 Primes, q, such that for three consecutive primes, p, q & r, with p

Original entry on oeis.org

3, 5, 7, 13, 19, 31, 43, 53, 61, 73, 103, 109, 139, 151, 157, 173, 181, 193, 199, 211, 229, 241, 257, 263, 271, 283, 313, 349, 373, 401, 421, 433, 463, 467, 491, 509, 523, 563, 571, 593, 601, 607, 619, 643, 653, 661, 733, 743, 761, 811, 823, 829, 859
Offset: 1

Views

Author

Robert G. Wilson v, Jan 10 2011

Keywords

Comments

The distance between the cited prime above to its immediate successor is divisible by the distance from that prime to its immediate predecessor.
Intersection(A184247, A184248): 5, 53, 157, 173, 211, .., = A006562: Balanced primes (of order 1).

Crossrefs

Cf. A184247.

Programs

  • Mathematica
    fQ[n_] := Block[{p = NextPrime[n, -1], q = n, r = NextPrime[n]}, IntegerQ[(r - q)/(q - p)]]; Select[ Prime@ Range@ 150, fQ]
    Transpose[Select[Partition[Prime[Range[200]],3,1],IntegerQ[(#[[3]]- #[[2]])/ (#[[2]]-#[[1]])]&]][[2]] (* Harvey P. Dale, Mar 30 2014 *)

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
Previous Showing 81-90 of 150 results. Next