login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A374507
Prime numbers that precede and follow consecutive balanced primes.
2
7829, 32491, 40087, 40099, 50423, 104009, 128461, 166967, 167747, 169307, 186259, 203011, 206209, 245759, 253987, 260387, 267581, 295271, 297403, 311021, 331159, 336163, 353081, 370009, 381389, 396079, 396449, 442843, 455431, 481513, 577867, 596599, 605861
OFFSET
1,1
LINKS
EXAMPLE
7817, 7823, 7829, 7841, and 7853 are consecutive primes. Since 7823 and 7841 are consecutive balanced primes (7817 + 7829 = 2*7823, 7829 + 7853 = 2*7841), 7829 is in this sequence.
MAPLE
p, q, r, s, t:= 2, 3, 5, 7, 11:
count:= 0: R:= NULL:
while count < 40 do
p, q, r, s:= q, r, s, t;
t:= nextprime(t);
if p+r = 2*q and r+t = 2*s then
count:= count+1;
R:= R, r;
fi;
od:
R; # Robert Israel, Jul 11 2024
MATHEMATICA
Select[Partition[Prime[Range[50000]], 5, 1], #[[2]]==(#[[1]]+#[[3]])/2&&#[[4]]==(#[[3]]+#[[5]])/2&][[;; , 3]] (* Harvey P. Dale, Sep 17 2024 *)
PROG
(C)
#include <stdio.h>
#define K 5
#include <math.h>
int main(void) {
int x[K], primej, z, md, n, maxd, count;
x[0] = 2; x[1] = 3; x[2] = 5; x[3] = 7; x[4] = 11;
primej = 1;
n = 13;
maxd = 3;
count = 0;
while (count < 50) {
for (md = 2; md <= maxd; md++) {
if (n % md == 0) {
primej = 0;
}
}
if (primej == 1) {
x[0] = x[1]; x[1] = x[2]; x[2] = x[3]; x[3] = x[4]; x[4] = n;
if (x[0] + x[2] == 2 * x[1] && x[2] + x[4] == 2 * x[3]) {
z = x[2];
count++;
printf("%d %d\n", count, z);
}
}
n += 2;
maxd = sqrt((double)n);
primej = 1;
}
return 0;
}
CROSSREFS
Cf. A006562 (balanced primes).
Sequence in context: A252317 A250026 A374576 * A194352 A234477 A286181
KEYWORD
nonn
AUTHOR
Kishin Ikemoto, Jul 09 2024
STATUS
approved