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.
%I A374507 #26 Oct 04 2024 14:20:29 %S A374507 7829,32491,40087,40099,50423,104009,128461,166967,167747,169307, %T A374507 186259,203011,206209,245759,253987,260387,267581,295271,297403, %U A374507 311021,331159,336163,353081,370009,381389,396079,396449,442843,455431,481513,577867,596599,605861 %N A374507 Prime numbers that precede and follow consecutive balanced primes. %H A374507 Kishin Ikemoto, <a href="/A374507/b374507.txt">Table of n, a(n) for n = 1..10000</a> %e A374507 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. %p A374507 p,q,r,s,t:= 2,3,5,7,11: %p A374507 count:= 0: R:= NULL: %p A374507 while count < 40 do %p A374507 p,q,r,s:= q,r,s,t; %p A374507 t:= nextprime(t); %p A374507 if p+r = 2*q and r+t = 2*s then %p A374507 count:= count+1; %p A374507 R:= R,r; %p A374507 fi; %p A374507 od: %p A374507 R; # _Robert Israel_, Jul 11 2024 %t A374507 Select[Partition[Prime[Range[50000]],5,1],#[[2]]==(#[[1]]+#[[3]])/2&&#[[4]]==(#[[3]]+#[[5]])/2&][[;;,3]] (* _Harvey P. Dale_, Sep 17 2024 *) %o A374507 (C) %o A374507 #include <stdio.h> %o A374507 #define K 5 %o A374507 #include <math.h> %o A374507 int main(void) { %o A374507 int x[K], primej, z, md, n, maxd, count; %o A374507 x[0] = 2; x[1] = 3; x[2] = 5; x[3] = 7; x[4] = 11; %o A374507 primej = 1; %o A374507 n = 13; %o A374507 maxd = 3; %o A374507 count = 0; %o A374507 while (count < 50) { %o A374507 for (md = 2; md <= maxd; md++) { %o A374507 if (n % md == 0) { %o A374507 primej = 0; %o A374507 } %o A374507 } %o A374507 if (primej == 1) { %o A374507 x[0] = x[1]; x[1] = x[2]; x[2] = x[3]; x[3] = x[4]; x[4] = n; %o A374507 if (x[0] + x[2] == 2 * x[1] && x[2] + x[4] == 2 * x[3]) { %o A374507 z = x[2]; %o A374507 count++; %o A374507 printf("%d %d\n", count, z); %o A374507 } %o A374507 } %o A374507 n += 2; %o A374507 maxd = sqrt((double)n); %o A374507 primej = 1; %o A374507 } %o A374507 return 0; %o A374507 } %Y A374507 Cf. A006562 (balanced primes). %K A374507 nonn %O A374507 1,1 %A A374507 _Kishin Ikemoto_, Jul 09 2024