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

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

A055380 Central prime p in the smallest (2n+1)-tuple of consecutive primes that are symmetric with respect to p.

Original entry on oeis.org

5, 18731, 683783, 98303927, 60335249959, 1169769749219, 3945769040699039, 159067808851610657, 6919940122097246597
Offset: 1

Views

Author

Jud McCranie, Jun 23 2000

Keywords

Comments

Least n-tuply balanced primes: primes which are averages of both their immediate neighbors, their second neighbors, their third neighbors, ... and their n-th neighbors.
a(9) <= 6919940122097246597. The solution was found by the BOINC project "SPT test project". - Natalia Makarova, Nov 25 2023
a(n) is the smallest number m such that A346399(m) = 2n + 1. - Ya-Ping Lu, May 12 2024

Examples

			In 5-tuple of consecutive primes (18713, 18719, 18731, 18743, 18749), the primes are symmetric w.r.t. its central prime 18731, since 18713+18749 = 18719+18743 = 2*18731, and this is the smallest such 5-tuple. Hence, a(2)=18731.
Alternatively, the symmetry can be seen from the differences between consecutive primes. For (18713, 18719, 18731, 18743, 18749), the differences are (6,12,12,6).
		

Crossrefs

Programs

  • Mathematica
    Table[i = n + 2;
     While[x = Differences[Table[Prime[k + i], {k, -n, n}]];
    x != Reverse[x], i++]; Prime[i], {n, 3}] (* Robert Price, Oct 12 2019 *)

Formula

a(n) = A151800^(n)(A175309(2n)), i.e., A151800 applied n times on A175309(2n). - Max Alekseyev, Jul 26 2014

Extensions

a(6) from Donovan Johnson, Mar 09 2008
Definition corrected by Max Alekseyev, Jul 29 2014
a(7) from Dmitry Petukhov, added by Max Alekseyev, Nov 03 2014
a(8) from SPT project, added by Dmitry Petukhov, Apr 06 2017
a(9) from SPT project, added by Dmitry Petukhov, Mar 25 2025

A082079 Balanced primes of order four.

Original entry on oeis.org

491, 757, 1787, 3571, 6337, 6451, 6991, 7741, 7907, 8821, 10141, 10267, 10657, 12911, 15299, 16189, 18223, 18701, 19801, 19843, 19853, 19937, 21961, 22543, 22739, 22807, 23893, 23909, 24767, 25169, 25391, 26591, 26641, 26693, 26713
Offset: 1

Views

Author

Labos Elemer, Apr 08 2003

Keywords

Comments

The arithmetic mean of 8 primes in its "neighborhood"; not to be confused with 'Quadruply balanced primes' (A096710).
A balanced prime of order four is not necessarily balanced (A006562) order one, or of order two (A082077), or of order three (A082078), etc.

Examples

			p = 491 = (463 + 467 + 479 + 487 + 491 + 499 + 503 + 509 + 521)/9 = 4419/9.
		

Crossrefs

Programs

  • GAP
    P:=Filtered([1..50000],IsPrime);;
    a:=List(Filtered(List([0..3000],k->List([5..13],j->P[j-4+k])), i-> Sum(i)/9=i[5]),m->m[5]); # Muniru A Asiru, Feb 14 2018
    
  • Mathematica
    Do[s3=Prime[n]+Prime[n+1]+Prime[n+2]; s5=Prime[n-1]+s3+Prime[n+3]; s7=Prime[n-2]+s5+Prime[n+4]; s9=Prime[n-3]+s7+Prime[n+5]; If[Equal[s9/9, Prime[n+1]], Print[Prime[n+1]]], {n, 4, 10000}]
    (* Second program: *)
    With[{k = 4}, Select[MapIndexed[{Prime[First@ #2 + k], #1} &, Mean /@ Partition[Prime@ Range[3000], 2 k + 1, 1]], SameQ @@ # &][[All, 1]]] (* Michael De Vlieger, Feb 15 2018 *)
    Select[Partition[Prime[Range[3000]],9,1],Mean[#]==#[[5]]&][[;;,5]] (* Harvey P. Dale, Mar 09 2023 *)
  • PARI
    isok(p) = {if (isprime(p), k = primepi(p); if (k > 4, sum(i=k-4, k+4, prime(i)) == 9*p;););} \\ Michel Marcus, Mar 07 2018

A051795 Doubly balanced primes: primes which are averages of both their immediate and their second neighbors.

Original entry on oeis.org

18731, 25621, 28069, 30059, 31051, 44741, 76913, 97441, 103669, 106681, 118831, 128449, 135089, 182549, 202999, 240491, 245771, 249199, 267569, 295387, 347329, 372751, 381401, 435751, 451337, 455419, 471521, 478099, 498301, 516877, 526441, 575231, 577873
Offset: 1

Views

Author

Harvey P. Dale, Dec 10 1999

Keywords

Comments

Could also be called overbalanced or [3,5]-balanced primes: balanced primes which are equally average of 3,5 consecutive prime neighbors as follows: a(n)=[q+a(n)+r]/3=[p+q+a(n)+r+s]/5 See 3-balanced=A006562;[3,5,7]-balanced=A081415. - Labos Elemer, Apr 02 2003
Numbers m such that A346399(m) is odd and >= 5. - Ya-Ping Lu, May 11 2024

Examples

			25621 belongs to the sequence because 25621 = (25609 + 25633)/2 = (25603 + 25609 + 25633 + 25639)/4.
		

Crossrefs

Programs

  • Mathematica
    Transpose[Select[Partition[Prime[Range[50000]],5,1],(#[[1]]+#[[5]])/2 == (#[[2]]+#[[4]])/2 == #[[3]]&]][[3]] (* Harvey P. Dale, Sep 13 2013 *)
  • Python
    from sympy import nextprime; p, q, r, s, t = 2, 3, 5, 7, 11
    while t < 580000:
        if p + t == q + s == 2*r: print(r, end = ', ')
        p, q, r, s, t = q, r, s, t, nextprime(t) # Ya-Ping Lu, May 11 2024

A175309 a(n) = the smallest prime prime(k) such that prime(k+j) - prime(k+j-1) = prime(n+k+1-j) - prime(n+k-j) for all j with 1 <= j <= n.

Original entry on oeis.org

2, 3, 5, 18713, 5, 683747, 17, 98303867, 13, 60335249851, 137, 1169769749111, 8021749, 3945769040698829, 1071065111, 159067808851610411, 1613902553, 6919940122097246303, 1797595814863
Offset: 1

Views

Author

Leroy Quet, Mar 27 2010

Keywords

Comments

From M. F. Hasler, Apr 02 2010: (Start)
Also: Start of the first sequence of n+1 consecutive primes symmetrically distributed w.r.t. their barycenter, e.g., [2,3], [3,5,7], [5,7,11,13], [18713, 18719, 18731, 18743, 18749]. With this definition, it would make sense to prefix the sequence with an initial term a(0)=2.
Sequence A081235 (or A055382, which is essentially the same) consists of every other term of this sequence. (End)
a(19) = 1797595814863, a(21) = 633925574060671, a(23) = 22930603692243271. - Tomáš Brada, May 25 2020

Crossrefs

Programs

  • Mathematica
    A175309[n_] := Module[{k},
       k = 1; While[! AllTrue[Range[n], Prime[k+#] - Prime[k+#-1] ==
            Prime[n+k+1-#] - Prime[n+k-#] &], k++]; Return[Prime[k]]];
    Table[A175309[n], {n, 1, 7}]  (* Robert Price, Mar 27 2019 *)
  • PARI
    a(n)={ my( last=vector(n++,i,prime(i)), m, i=Mod(n-2,n)); forprime(p=last[n],default(primelimit), m=last[1+lift(i+2)]+last[1+lift(i++)]=p; for( j=1,n\2, last[1+lift(i-j)]+last[1+lift(i+j+1)]==m || next(2)); return( last[1+lift(i+1)])) } \\ M. F. Hasler, Apr 02 2010
    
  • PARI
    isok(p, n) = {my(k=primepi(p)); for (j=1, n, if (prime(k+j) - prime(k+j-1) != prime(n+k+1-j) - prime(n+k-j), return (0));); return (1);} \\ Michel Marcus, Apr 08 2017

Formula

a(2n-1) = A081235(n) (= A055382(n) for n>1). - M. F. Hasler, Apr 02 2010

Extensions

Terms through a(12) were calculated by (in alphabetical order) Franklin T. Adams-Watters, Hans Havermann and D. S. McNeil
Minor edits by N. J. A. Sloane, Apr 02 2010
a(14) from Dmitry Petukhov, added by Max Alekseyev, Nov 03 2014
a(16) from BOINC project, added by Dmitry Petukhov, Apr 06 2017
a(18)-a(19) from SPT test project, added by Dmitry Petukhov, Mar 16 2025

A081415 Triply balanced primes: primes which are averages of both their immediate neighbor, their second neighbors and their third neighbors.

Original entry on oeis.org

683783, 1056317, 1100261, 2241709, 2815301, 4746359, 10009049, 12003209, 13810981, 14907649, 15403009, 15730067, 16595081, 17518201, 19755301, 20378327, 21006487, 21574453, 21579983, 22237121, 22625179, 25876901, 26018791, 26354201, 27188141, 28469461
Offset: 1

Views

Author

Labos Elemer, Apr 02 2003

Keywords

Comments

Equivalently, primes which are balanced primes of orders 1, 2, and 3. - Muniru A Asiru, Apr 08 2018
Numbers m such that A346399(m) is odd and >= 7. - Ya-Ping Lu, May 11 2024

Examples

			p = 683383: 683747 + ... + p + ... + 683819 = 7p; 683759 + ... + p + ... + 683807 = 5p; 683777 + p + 683789 = 3p.
		

Crossrefs

Programs

  • GAP
    P:=Filtered([1,3..3*10^7+1],IsPrime);;
    a:=Intersection(List([1,2,3],b->List(Filtered(List([0..Length(P)-(2*b+1)],k->List([1..2*b+1],j->P[j+k])),i->Sum(i)/(2*b+1)=i[b+1]),m->m[b+1]))); # Muniru A Asiru, Apr 08 2018
    
  • Mathematica
    a = {}; Do[p = 2Prime[n]; If[p == Prime[n - 1] + Prime[n + 1] && p == Prime[n - 2] + Prime[n + 2] && p == Prime[n - 3] + Prime[n + 3], Print[p / 2]; AppendTo[a, p / 2]], {n, 5, 1100000}]; a (* Robert G. Wilson v, Jun 28 2004 *)
    Transpose[Select[Partition[Prime[Range[1620000]],7,1],(#[[1]]+#[[7]])/2 == (#[[2]]+#[[6]])/2==(#[[3]]+#[[5]])/2==#[[4]]&]][[4]] (* Harvey P. Dale, Sep 13 2013 *)
  • Python
    from sympy import nextprime; p, q, r, s, t, u, v = 2, 3, 5, 7, 11, 13, 17
    while v < 29000000:
        if p + v == q + u == r + t == 2*s: print(s, end = ', ')
        p, q, r, s, t, u, v = q, r, s, t, u, v, nextprime(v) # Ya-Ping Lu, May 11 2024

A082080 Smallest balanced prime of order n.

Original entry on oeis.org

2, 5, 79, 17, 491, 53, 71, 29, 37, 983, 5503, 173, 157, 353, 5297, 263, 179, 383, 137, 2939, 2083, 751, 353, 5501, 1523, 149, 4561, 1259, 397, 787, 8803, 8803, 607, 227, 3671, 17443, 57097, 3607, 23671, 12539, 1217, 11087, 1087, 21407, 19759, 953
Offset: 0

Views

Author

Labos Elemer, Apr 08 2003

Keywords

Comments

Or, smallest (2n+1)-balanced prime number.
Prime(k) is a balanced prime of order n if it is the average of the 2n+1 primes from prime(k-n) to prime(k+n).

Examples

			a(1) = 5 = (3 + 5 + 7)/3 = 15/3.
a(5) = 53 = (31 + 37 + 41 + 43 + 47 + 53 + 59 + 61 + 67 + 71 + 73)/11 = 583/11.
a(6) = 71 = (43 + 47 + 53 + 59 + 61 + 67 + 71 + 73 + 79 + 83 + 89 + 97 + 101)/13 = 923/13.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{p = Prime@ Range[2n +1]}, While[ Total[p] != (2n +1) p[[n +1]], p = Join[Rest@ p, {NextPrime[ p[[-1]]] }]]; p[[n +1]]]; Array[f, 46, 0] (* Robert G. Wilson v, Jun 21 2004 and modified Apr 11 2017 *)
  • PARI
    for(n=0, 50, i=2*n+1;f=0;forprime(p=2, 10^7, s=0;c=i;pr=p-1;t=0;while(c>0, c=c-1;pr=nextprime(pr+1);s=s+pr; if(c==(i-1)/2, t=pr)); if(s/i==t, print1(t", ");f=1;break)); if(!f, print1("0, ")))

Extensions

Corrected and extended by Ralf Stephan, Apr 09 2003

A166113 Center element of a 3 X 3 magic square composed of consecutive primes.

Original entry on oeis.org

1480028171, 1850590099, 5196185989, 5601567229, 5757284539, 6048371071, 6151077311, 9517122301, 19052235889, 20477868361, 23813359697, 24026890201, 26748150313, 28519991429, 34821326161, 44420969951, 49285771751, 73827799051, 73974781931, 74220519391, 76483907879, 76560277051, 80143089671, 85892025269, 89132925809, 95515449079, 99977424731
Offset: 1

Views

Author

Max Alekseyev, Oct 06 2009

Keywords

Crossrefs

Cf. A073519, A256891, A270305. Subsequence of A096710.

Formula

An element p of A096710 belongs to this sequence iff q+r=s+p and (q+s=p+t or r+s=p+t), where p,q,r,s,t are consecutive primes.
a(n) = A270305(n)/3. - Arkadiusz Wesolowski, Mar 14 2016

Extensions

Extended by Max Alekseyev, Oct 13 2009
a(19)-a(27) added by Natalia Makarova, Oct 30 2015
Showing 1-8 of 8 results.