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-9 of 9 results.

A058869 Duplicate of A054342.

Original entry on oeis.org

5, 53, 211, 20201, 16787, 69623, 255803, 247141, 3565979, 6314447, 4911311
Offset: 1

Views

Author

Keywords

A006562 Balanced primes (of order one): primes which are the average of the previous prime and the following prime.

Original entry on oeis.org

5, 53, 157, 173, 211, 257, 263, 373, 563, 593, 607, 653, 733, 947, 977, 1103, 1123, 1187, 1223, 1367, 1511, 1747, 1753, 1907, 2287, 2417, 2677, 2903, 2963, 3307, 3313, 3637, 3733, 4013, 4409, 4457, 4597, 4657, 4691, 4993, 5107, 5113, 5303, 5387, 5393
Offset: 1

Views

Author

Keywords

Comments

Subsequence of A075540. - Franklin T. Adams-Watters, Jan 11 2006
This subsequence of A125830 and of A162174 gives primes of level (1,1): More generally, the i-th prime p(i) is of level (1,k) if and only if it has level 1 in A117563 and 2 p(i) - p(i+1) = p(i-k). - Rémi Eismann, Feb 15 2007
Note the similarity between plots of A006562 and A013916. - Bill McEachen, Sep 07 2009
Balanced primes U strong primes = good primes. Or, A006562 U A051634 = A046869. - Juri-Stepan Gerasimov, Mar 01 2010
Primes prime(n) such that A001223(n-1) = A001223(n). - Irina Gerasimova, Jul 11 2013
Numbers m such that A346399(m) is odd and >= 3. - Ya-Ping Lu, Dec 26 2021 and May 07 2024
"Balanced" means that the next and preceding gap are of the same size, i.e., the second difference A036263 vanishes; so these are the primes whose indices are 1 more than indices of zeros in A036263, listed in A064113. - M. F. Hasler, Oct 15 2024
Primes which are the average of three consecutive primes. - Peter Schorn, Apr 30 2025

Examples

			5 belongs to the sequence because 5 = (3 + 7)/2. Likewise 53 = (47 + 59)/2.
5 belongs to the sequence because it is a term, but not first or last, of the AP of consecutive primes (3, 5, 7).
53 belongs to the sequence because it is a term, but not first or last, of the AP of consecutive primes (47, 53, 59).
257 and 263 belong to the sequence because they are terms, but not first or last, of the AP of consecutive primes (251, 257, 263, 269).
		

References

  • A. Murthy, Smarandache Notions Journal, Vol. 11 N. 1-2-3 Spring 2000.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers (Rev. ed. 1997), p. 134.

Crossrefs

Primes A000040 whose indices are 1 more than A064113, indices of zeros in A036263 (second differences of the primes).
Cf. A225494 (multiplicative closure); complement of A178943 with respect to A000040.
Cf. A055380, A051795, A081415, A096710 for other balanced prime sequences.

Programs

  • Haskell
    a006562 n = a006562_list !! (n-1)
    a006562_list = filter ((== 1) . a010051) a075540_list
    -- Reinhard Zumkeller, Jan 20 2012
    
  • Haskell
    a006562 n = a006562_list !! (n-1)
    a006562_list = h a000040_list where
       h (p:qs@(q:r:ps)) = if 2 * q == (p + r) then q : h qs else h qs
    -- Reinhard Zumkeller, May 09 2013
    
  • Magma
    [a: n in [1..1000] | IsPrime(a) where a is NthPrime(n)-NthPrime(n+1)+NthPrime(n+2)]; // Vincenzo Librandi, Jun 23 2016
    
  • Mathematica
    Transpose[ Select[ Partition[ Prime[ Range[1000]], 3, 1], #[[2]] ==(#[[1]] + #[[3]])/2 &]][[2]]
    p=Prime[Range[1000]]; p[[Flatten[1+Position[Differences[p, 2], 0]]]]
    Prime[#]&/@SequencePosition[Differences[Prime[Range[800]]],{x_,x_}][[All,2]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 31 2019 *)
  • PARI
    betwixtpr(n) = { local(c1,c2,x,y); for(x=2,n, c1=c2=0; for(y=prime(x-1)+1,prime(x)-1, if(!isprime(y),c1++); ); for(y=prime(x)+1,prime(x+1)-1, if(!isprime(y),c2++); ); if(c1==c2,print1(prime(x)",")) ) } \\ Cino Hilliard, Jan 25 2005
    
  • PARI
    forprime(p=1,999, p-precprime(n-1)==nextprime(p+1)-p && print1(p",")) \\ M. F. Hasler, Jun 01 2013
    
  • PARI
    is(n)=n-precprime(n-1)==nextprime(n+1)-n && isprime(n) \\ Charles R Greathouse IV, Apr 07 2016
    
  • Python
    from sympy import nextprime; p, q, r = 2, 3, 5
    while q < 6000:
        if 2*q == p + r: print(q, end = ", ")
        p, q, r = q, r, nextprime(r) # Ya-Ping Lu, Dec 23 2021

Formula

2*p_n = p_(n-1) + p_(n+1).
Equals { p = prime(k) | A118534(k) = prime(k-1) }. - Rémi Eismann, Nov 30 2009
a(n) = A000040(A064113(n) + 1) = (A122535(n) + A181424(n)) / 2. - Reinhard Zumkeller, Jan 20 2012
a(n) = A122535(n) + A117217(n). - Zak Seidov, Feb 14 2013
Equals A145025 intersect A000040 = A145025 \ A024675. - M. F. Hasler, Jun 01 2013
Conjecture: Limit_{n->oo} n*(log(a(n)))^2 / a(n) = 1/2. - Alain Rocchelli, Mar 21 2024
Conjecture: The asymptotic limit of the average of a(n+1)-a(n) is equivalent to 2*(log(a(n)))^2. Otherwise formulated: 2 * Sum_{n=1..N} (log(a(n)))^2 ~ a(N). - Alain Rocchelli, Mar 23 2024

Extensions

Reworded comment and added formula from R. Eismann. - M. F. Hasler, Nov 30 2009
Edited by Daniel Forgues, Jan 15 2011

A052187 a(n) is the smallest prime p such that p, p+d, and p+2d are consecutive primes where d = 2 for n = 1 and d = 6*(n-1) for n > 1.

Original entry on oeis.org

3, 47, 199, 20183, 16763, 69593, 255767, 247099, 3565931, 6314393, 4911251, 12012677, 23346737, 43607351, 34346203, 36598517, 51041957, 460475467, 652576321, 742585183, 530324329, 807620651, 2988119207, 12447231761, 383204539, 4470607951, 5007182707
Offset: 1

Views

Author

Labos Elemer, Jan 28 2000

Keywords

Comments

The first term 3 is anomalous since for all others d is divisible by 6. These are minimal terms if in A047948 d=6 is replaced by possible differences: (2), 6, 12, 18, ..., 54, 60.
a(54) > 5*10^13, while a(55) = 46186474937633. - Giovanni Resta, Apr 08 2013

Examples

			a(2)=47 and it is the lower border of a dd pattern: 47[6 ]53[6 ]59. a(10)=6314393 and a(10)+54=6314447, a(10)+108=6314501 are consecutive primes and 6314393 is the smallest prime prior to a (54,54) difference pattern of A001223.
		

Crossrefs

Programs

  • Mathematica
    a = Table[0, {100}]; NextPrime[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; p = q = r = 0; Do[r = NextPrime[r]; If[r + p == 2q && r - q < 201 && a[[(r - q)/2]] == 0, a[[(r - q)/2]] = p]; p = q; q = r, {n, 1, 10^6}]; a (* Typos fixed by Zak Seidov, May 01 2020 *)
  • PARI
    list(n)=ve=vector(n);ppp=2;pp=3;forprime(p=5,,d=p-pp;if(pp-ppp==d,i=d\6+1;if(i<=n&&ve[i]==0,ve[i]=ppp;print1(".");vecprod(ve)>0&&return(ve)));ppp=pp;pp=p) \\ Jeppe Stig Nielsen, Apr 17 2022

Formula

The least prime(k) such that prime(k+1) = (prime(k) + prime(k+2))/2 and prime(k+1) - prime(k) = d is either 2 or divisible by 6.
a(1) = A054342(1) - 2. For n>1, a(n) = A054342(n) - 6*(n-1). - Jeppe Stig Nielsen, Apr 16 2022

Extensions

More terms from Labos Elemer, Jan 04 2002
More terms from Robert G. Wilson v, Jan 06 2002
Definition clarified by Harvey P. Dale, Aug 29 2012
a(23)-a(27) from Donovan Johnson, Aug 30 2012
Name edited by Jon E. Schoenfield, Nov 30 2023

A058867 Equidistant lonely primes. Each prime is the same distance (gap) from the preceding prime and the next prime. These distances are maximal: each distance is larger than all such previous distances.

Original entry on oeis.org

5, 53, 211, 16787, 69623, 247141, 3565979, 4911311, 12012743, 23346809, 34346287, 36598607, 51042053, 383204683, 4470608101, 5007182863, 5558570491, 48287689717, 50284155289, 178796541817, 264860525507, 374787490919, 1521870804107, 2093308790851, 4228611064537, 6537587646671, 17432065861517, 22546768250359, 26923643849953, 187891466722913
Offset: 1

Views

Author

Harvey Dubner (harvey(AT)dubner.com), Dec 07 2000; extended Sep 11 2004

Keywords

Examples

			47, 53 and 59 are primes. There are no other primes between 47 and 59 and 59-53=53-47=6. There are no other such primes with a smaller distance so 53 is included in the sequence.
		

Crossrefs

The distances are in A058868. First occurrences of distances are in A054342.

Programs

  • Maple
    Primes:= select(isprime,[2,seq(2*i+1,i=1..10^7)]):
    g:= 0: count:= 0:
    for i from 2 to nops(Primes)-1 do
      if Primes[i+1]+Primes[i-1] = 2*Primes[i] and Primes[i+1]-Primes[i] > g then
         count:= count+1;
         a[count]:= Primes[i];
         g:= Primes[i+1]-Primes[i];
      fi
    od:
    seq(a[i],i=1..count); # Robert Israel, Sep 20 2015

Extensions

a(21)-a(30) from Dmitry Petukhov, Sep 22 2015

A058868 Maximal distances of equidistant lonely primes shown in A058867.

Original entry on oeis.org

2, 6, 12, 24, 30, 42, 48, 60, 66, 72, 84, 90, 96, 144, 150, 156, 168, 186, 198, 204, 210, 228, 240, 258, 276, 300, 306, 348, 390, 420
Offset: 0

Views

Author

Harvey Dubner (harvey(AT)dubner.com), Dec 07 2000; extended Sep 11 2004

Keywords

Comments

These are the distances described in A058867. First occurrences of distances are in A054342.

Examples

			53 is an equidistant lonely prime. The distance to both the next prime and the previous prime is 6, larger than for any smaller prime. Thus 6 is in the sequence.
		

Extensions

a(20)-a(29) from Dmitry Petukhov, Sep 22 2015

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

A272021 Balanced primes separated from the next lower and next higher prime neighbors by 66.

Original entry on oeis.org

12012743, 12147463, 13408397, 15303667, 32676733, 34460407, 36050293, 36685867, 36804487, 37657423, 41516063, 51146867, 54702367, 56379217, 57203687, 58250207, 60696803, 63699127, 73576067, 74663377, 76853827, 78725443, 82015313, 92438317, 94073923, 94988423
Offset: 1

Views

Author

Wendy Appleby, Apr 18 2016

Keywords

Comments

This was generated by calculating the first million primes in a spreadsheet, finding their differences and then looking for two consecutive differences equal to 66.

Crossrefs

Programs

  • Mathematica
    Prime[Last /@ SequencePosition[ Differences@ Prime@ Range[4 *10^6], {66, 66}]] (* Giovanni Resta, Apr 18 2016 *)
  • PARI
    list(lim)=my(v=List(),p=2,q=3); forprime(r=5,nextprime(lim+1), if(q-p==66 && r-q==66, listput(v,q)); p=q;q=r); Vec(v) \\ Charles R Greathouse IV, Apr 18 2016

Extensions

a(5)-a(26) from Giovanni Resta, Apr 18 2016

A308764 Table read by antidiagonals: T(n,k) is the smallest prime that differs from its predecessor and successor by 2n and 2k, respectively.

Original entry on oeis.org

5, 7, 11, 31, 0, 29, 0, 23, 37, 0, 139, 401, 53, 97, 149, 199, 0, 89, 367, 0, 521, 0, 467, 337, 0, 251, 223, 0, 1933, 113, 509, 409, 701, 1543, 127, 1949, 523, 0, 953, 1201, 0, 479, 331, 0, 1277, 0, 2861, 3643, 0, 797, 631, 0, 3407, 1087, 0, 1951, 887, 1069, 1831, 293, 211, 787, 2609, 541, 907, 1151
Offset: 1

Views

Author

Jon E. Schoenfield, Jun 23 2019

Keywords

Comments

If two consecutive primes p and q appear in the table, then the column number in which p appears is the row number in which q appears. E.g., 23 is in column 3 and 29 is in row 3, 29 is in column 1 and 31 is in row 1, 113 is in column 7 and 127 is in row 7, 3643 is in column 8 and 3659 is in row 8.
Nonzero terms on the main diagonal are the terms of A054342.

Examples

			T(1,1)=5 because 5 is the only prime p whose predecessor and successor primes are p-2 and p+2, respectively (i.e., 3 and 7).
T(7,2)=127 because 127 is the smallest prime p whose predecessor and successor primes are p-14 and p+4, respectively (i.e., 113 and 131).
T(2,2)=0: the only set of three numbers {p-4, p, p+4} that are all prime is the set {3, 7, 11}, but these are not consecutive primes. (For every set of three integers {m-4, m, m+4}, exactly one of the three is divisible by 3.)
Table begins:
     5,     7,    31,     0,   139,   199,     0,  1933, ...
    11,     0,    23,   401,     0,   467,   113,     0, ...
    29,    37,    53,    89,   337,   509,   953,  3643, ...
     0,    97,   367,     0,   409,  1201,     0,  1831, ...
   149,     0,   251,   701,     0,   797,   293,     0, ...
   521,   223,  1543,   479,   631,   211,  2633,  4111, ...
     0,   127,   331,     0,   787,  7057,     0, 13381, ...
  1949,     0,  3407,  2609,     0,  3659,  1847,     0, ...
   ...    ...    ...    ...    ...    ...    ...    ...  ...
		

Crossrefs

Cf. A000040 (primes), A001223 (prime gaps), A054342 (first occurrence of distances of equidistant lonely primes).

Formula

T(n,k)=0 if n == k (mod 3) !== 0 (mod 3), with the exception of T(1,1)=5.

A101328 Recurring numbers in the count of consecutive composite numbers between balanced primes and their lower or upper prime neighbors.

Original entry on oeis.org

1, 5, 11, 17, 23, 29, 35, 41, 47, 53, 59, 65, 71, 77, 83, 89, 95, 101, 107, 113, 119, 125, 131, 137, 143, 149, 155, 161, 167, 173, 179, 185, 191, 197, 203, 209, 215, 221, 227, 233, 239, 245, 251, 257, 263, 269, 275, 281, 287, 293, 299, 305, 311, 317, 323, 329
Offset: 2

Views

Author

Cino Hilliard, Jan 26 2005

Keywords

Comments

Except for the initial term, these numbers appear to differ by 6. Proof?
Numbers that occur in A101597. - David Wasserman, Mar 26 2008
There is no proof (yet). Heuristic evidence (Hardy-Littlewood 1923) and extensive computations indicates that the balanced-prime structure is not accidental. A theorem of van der Carput (1939) already guarantees infinitely many 3-term arithmetic progressions of primes exist, although not all of those progressions are consecutive primes. A full proof that every such 6k gap occurs infinitely often (and thus infinitely many balanced primes) remains elusive. - Hilko Koning, Apr 15 2025

Crossrefs

Conjectured partial sums of A329502.

Programs

  • Mathematica
    balancedPrimes = {};compositeGaps = {}; Do[pPrev = Prime[i];p = Prime[i + 1]; pNext = Prime[i + 2]; If[p == (pPrev + pNext)/2, AppendTo[balancedPrimes, p];
    gap1 = p - pPrev - 1; gap2 = pNext - p - 1; AppendTo[compositeGaps, gap1]; AppendTo[compositeGaps, gap2];], {i, 1, 50000}];recurringCounts = Select[Tally[compositeGaps], #[[2]] > 1 &][[All, 1]]; Sort[recurringCounts](* Hilko Koning, Apr 15 2025 *)
    (* or with balanced primes *)
    targetGaps = {1, 5, 11, 17, 23, 29, 35, 41, 47}; gapToBalancedPrimes = Association @@ (Rule[#, {}] & /@ targetGaps); Do[pPrev = Prime[i]; p = Prime[i + 1]; pNext = Prime[i + 2]; If[p == (pPrev + pNext)/2, gap1 = p - pPrev - 1; gap2 = pNext - p -1;uniqueGaps = DeleteDuplicates[{gap1, gap2}]; Do[If[KeyExistsQ[gapToBalancedPrimes, gap], gapToBalancedPrimes[gap] = Append[gapToBalancedPrimes[gap], p]], {gap,uniqueGaps}];], {i, 1, 50000}]; gapToBalancedPrimes (* Hilko Koning, Apr 15 2025 *)

Formula

If the numbers continue to differ by 6, then this is the sum of paired terms of 3n+1: (1, 4, 7, 10, 13, ...); and binomial transform of [1, 4, 2, -2, 2, -2, 2, ...]. - Gary W. Adamson, Sep 13 2007
a(n) = nextprime(A054342(n)+1)-A054342(n)-1. - David Wasserman, Mar 26 2008

Extensions

More terms from David Wasserman, Mar 26 2008
Showing 1-9 of 9 results.