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
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).
- 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.
- T. D. Noe, Table of n, a(n) for n = 1..10000
- M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards, Applied Math. Series 55, Tenth Printing, 1972, p. 870.
- Ernest G. Hibbs, Component Interactions of the Prime Numbers, Ph. D. Thesis, Capitol Technology Univ. (2022), see p. 33.
- Shubhankar Paul, Ten Problems of Number Theory, International Journal of Engineering and Technical Research (IJETR), ISSN: 2321-0869, Volume-1, Issue-9, November 2013.
- Shubhankar Paul, Legendre, Grimm, Balanced Prime, Prime triple, Polignac's conjecture, a problem and 17 tips with proof to solve problems on number theory, International Journal of Engineering and Technical Research (IJETR), ISSN: 2321-0869, Volume-1, Issue-10, December 2013.
- Wikipedia, Balanced prime.
Primes
A000040 whose indices are 1 more than
A064113, indices of zeros in
A036263 (second differences of the primes).
Cf.
A082077,
A082078,
A082079,
A096697,
A096698,
A096699,
A096700,
A096701,
A096702,
A096703,
A096704,
A096693,
A051634,
A051635,
A054342,
A117078,
A117563,
A125830,
A117876,
A125576,
A046869,
A173891,
A173892,
A173893,
A006560,
A075540.
-
a006562 n = a006562_list !! (n-1)
a006562_list = filter ((== 1) . a010051) a075540_list
-- Reinhard Zumkeller, Jan 20 2012
-
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
-
[a: n in [1..1000] | IsPrime(a) where a is NthPrime(n)-NthPrime(n+1)+NthPrime(n+2)]; // Vincenzo Librandi, Jun 23 2016
-
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 *)
-
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
-
forprime(p=1,999, p-precprime(n-1)==nextprime(p+1)-p && print1(p",")) \\ M. F. Hasler, Jun 01 2013
-
is(n)=n-precprime(n-1)==nextprime(n+1)-n && isprime(n) \\ Charles R Greathouse IV, Apr 07 2016
-
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
Reworded comment and added formula from R. Eismann. -
M. F. Hasler, Nov 30 2009
A064113
Indices k such that (1/3)*(prime(k)+prime(k+1)+prime(k+2)) is a prime.
Original entry on oeis.org
2, 15, 36, 39, 46, 54, 55, 73, 102, 107, 110, 118, 129, 160, 164, 184, 187, 194, 199, 218, 239, 271, 272, 291, 339, 358, 387, 419, 426, 464, 465, 508, 520, 553, 599, 605, 621, 629, 633, 667, 682, 683, 702, 709, 710, 733, 761, 791, 813, 821, 822, 829, 830
Offset: 1
a(2) = 15 because (p(15)+p(16)+p(17)) = 1/3(47 + 53 + 59) = 53 (prime average of three successive primes).
Splitting the prime gaps into anti-runs gives: (1,2), (2,4,2,4,2,4,6,2,6,4,2,4,6), (6,2,6,4,2,6,4,6,8,4,2,4,2,4,14,4,6,2,10,2,6), (6,4,6), ... Then a(n) is the n-th partial sum of the lengths of these anti-runs. - _Gus Wiseman_, Mar 24 2020
Indices of zeros in
A036263 (second differences of primes).
The version for strict ascents is
A258025.
The version for strict descents is
A258026.
The version for weak ascents is
A333230.
The version for weak descents is
A333231.
A triangle for anti-runs of compositions is
A106356.
Lengths of maximal runs of prime gaps are
A333254.
Anti-runs of compositions in standard order are
A333381.
-
import Data.List (elemIndices)
a064113 n = a064113_list !! (n-1)
a064113_list = map (+ 1) $ elemIndices 0 a036263_list
-- Reinhard Zumkeller, Jan 20 2012
-
ct = 0; Do[If[(Prime[k] + Prime[k + 2] - 2*Prime[k + 1]) == 0, ct++; n[ct] = k], {k, 1, 2000}]; Table[n[k], {k, 1, ct}] (* Lei Zhou, Dec 06 2005 *)
Join@@Position[Differences[Array[Prime,100],2],0] (* Gus Wiseman, Mar 24 2020 *)
-
d(n) = prime(n+1)-prime(n); j=[]; for(n=1,1500, if(d(n)==d(n+1), j=concat(j,n))); j
-
{ n=0; for (m=1, 10^9, if (d(m)==d(m+1), write("b064113.txt", n++, " ", m); if (n==1000, break)) ) } \\ Using d(n) above. - Harry J. Smith, Sep 07 2009
-
[n | n<-[1..888], !A036263(n)] \\ M. F. Hasler, Oct 15 2024
-
\\ More efficient for larges range of n:
A064113_upto(N, n=1, L=List(), q=prime(n+1), d=q-prime(n))={forprime(p=1+q,, if(d==d=p-q, listput(L,n); #LM. F. Hasler, Oct 15 2024
-
from itertools import count, islice
from sympy import prime, nextprime
def A064113_gen(startvalue=1): # generator of terms >= startvalue
c = max(startvalue,1)
p = prime(c)
q = nextprime(p)
r = nextprime(q)
for k in count(c):
if p+r==(q<<1):
yield k
p, q, r = q, r, nextprime(r)
A064113_list = list(islice(A064113_gen(),20)) # Chai Wah Wu, Feb 27 2024
A298073
The first of three consecutive integers the sum of which is equal to the sum of three consecutive prime numbers.
Original entry on oeis.org
4, 52, 156, 172, 210, 256, 262, 372, 510, 536, 562, 592, 606, 652, 732, 946, 976, 998, 1072, 1102, 1122, 1186, 1222, 1238, 1366, 1460, 1500, 1510, 1540, 1746, 1752, 1762, 1772, 1898, 1906, 1916, 2070, 2180, 2286, 2400, 2408, 2416, 2448, 2676, 2902, 2962
Offset: 1
52 is in the sequence because 52 + 53 + 54 = 159 = 47 + 53 + 59.
Cf.
A075540: the second of the three consecutive integers.
-
Block[{nn = 430, s}, s = Total /@ Partition[Prime@ Range[nn], 3, 1]; Select[Partition[Range[Prime@ nn], 3, 1], MemberQ[s, Total@ #] &]][[All, 1]] (* Michael De Vlieger, Jan 11 2018 *)
(#-3)/3&/@Select[Total/@Partition[Prime[Range[500]],3,1],Mod[#,3]==0&] (* Harvey P. Dale, Sep 13 2018 *)
-
L=List(); forprime(p=2, 4000, q=nextprime(p+1); r=nextprime(q+1); t=p+q+r; if((t-3)%3==0, listput(L, (t-3)/3))); Vec(L)
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
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.
Cf.
A096693,
A006562,
A082077,
A082078,
A082079,
A096697,
A096698,
A096699,
A096700,
A096701,
A096702,
A096703,
A096704.
-
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 *)
-
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, ")))
A337489
a(n) is the k-th prime, such that abs(prime(k) - Sum_{j=k-1..k+1} prime(j)/3) sets a new record.
Original entry on oeis.org
3, 7, 29, 113, 523, 1151, 1327, 9551, 15683, 19609, 25471, 31397, 156007, 360653, 370261, 492113, 1349533, 1357201, 1357333, 1562051, 2010733, 4652507, 17051707, 17051887, 20831323, 47326693, 47326913, 122164747, 189695893, 191912783, 387096133, 428045741, 436273291
Offset: 1
List of first terms:
a(n) pi(a(n)) average-median
3, 2, 1/3 = (2 + 3 + 5)/3 - 3
7, 4, 2/3 = (5 + 7 + 11)/3 - 7
29, 10, -4/3 = (23 + 29 + 31)/3 - 29
113, 30, 10/3
523, 99, 16/3
1151, 190, -20/3
1327, 217, 28/3
9551, 1183, 32/3
-
a337489(limp) = {my(p1=0, p2=2, p3=3, s=p1+p2+p3, d=0); forprime(p=5, limp, s=s-p1+p; my(dd=abs(s/3-p3)); if(dd>d, print1(p3, ", "); d=dd); p1=p2; p2=p3; p3=p)};
a337489(500000000)
A075541
Numbers k such that prime(k) + prime(k+1) + prime(k+2) is a multiple of 3.
Original entry on oeis.org
2, 15, 36, 39, 46, 54, 55, 73, 96, 99, 102, 107, 110, 118, 129, 160, 164, 167, 179, 184, 187, 194, 199, 202, 218, 231, 238, 239, 242, 271, 272, 273, 274, 290, 291, 292, 311, 326, 339, 356, 357, 358, 362, 387, 419, 426, 437, 438, 449, 452, 464, 465, 489, 508
Offset: 1
a(2) = 15 because (prime(15)+prime(16)+prime(17)) = (1/3)*(47 + 53 + 59) = 53 (integer average of three successive primes).
-
R:= NULL: count:= 0:
q:= 2: r:= 3:
for i from 1 while count < 100 do
p:= q; q:= r; r:= nextprime(r);
if p+q+r mod 3 = 0 then
R:= R,i; count:= count+1
fi
od:
R; # Robert Israel, Nov 10 2024
-
A075541= {}; Do[If[IntegerQ[s3 = (Prime[i] + Prime[i + 1] + Prime[i + 2])/3], A075541 = Append[A075541, i]], {i, 1000}]; (* 119 terms*)
A082312
Half the difference between start and center prime of the smallest [2n+1]-balanced prime set (A082080).
Original entry on oeis.org
1, 4, 5, 14, 11, 14, 12, 15, 32, 36, 32, 30, 41, 65, 42, 41, 53, 45, 75, 76, 69, 63, 99, 98, 60, 112, 99, 84, 94, 130, 132, 103, 87, 140, 172, 175, 144, 190, 171, 140, 200, 145, 203, 190, 155, 168, 202, 210, 144, 157, 254, 185, 189, 306, 201, 323, 303, 229, 267
Offset: 1
The smallest 5-balanced prime, 79 (center of 71,73,79,83,89) minus 8 is 71, so a(2)=8/2=4.
-
for(n=1, 80, 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-p)/2", "); f=1; break)); if(!f, print1("0, ")))
A349793
Primes which are the nearest integer to the harmonic mean of the previous prime and the following prime.
Original entry on oeis.org
3, 7, 13, 23, 47, 89, 157, 173, 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
-
Select[Partition[Prime[Range[750]],3,1],Round[HarmonicMean[{#[[1]],#[[3]]}]]==#[[2]]&][[;;,2]] (* Harvey P. Dale, Dec 29 2024 *)
-
a349793(limit) = {my(p1=2,p2=3); forprime(p3=5, limit, my(hm=round((2*p1*p3)/(p1+p3))); if(p2==hm, print1(p2,", ")); p1=p2;p2=p3)};
a349793(5500)
Showing 1-8 of 8 results.
Comments