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.

A125525 Centrist primes: primes such that both the right half and the left half of the prime are prime.

This page as a plain text file.
%I A125525 #32 Jun 22 2019 10:47:17
%S A125525 2,3,5,7,23,37,53,73,223,227,233,257,263,277,283,293,307,313,317,337,
%T A125525 347,353,367,373,383,397,503,523,547,557,563,577,587,593,727,733,743,
%U A125525 757,773,787,797,1103,1117,1123,1129,1153,1171,1303,1307,1319,1361,1367
%N A125525 Centrist primes: primes such that both the right half and the left half of the prime are prime.
%C A125525 If the length of n > 9 is odd then the central number is not used in the calculation. So neither the left half nor the right half will contain the central digit. If the length of n is even, then all numbers are used. My guess is there are infinitely many of these numbers.
%C A125525 Number of n-digit terms for n=1..9: {4, 4, 33, 92, 1100, 3223, 37611, 130607, 1590017}. - _Zak Seidov_, Feb 19 2015
%H A125525 Zak Seidov, <a href="/A125525/b125525.txt">Table of n, a(n) for n = 1..10000</a>
%e A125525 The left half of 23 is 2 which is prime. The right half is 3 which is also prime so 23 is a centrist prime. [Corrected by _N. J. A. Sloane_, Jan 12 2019]
%o A125525 (PARI) left(str, n) = /* Get the left n characters from string str */ { my(v, tmp, x); v =""; tmp = Vec(str); ln=length(tmp); if(n > ln, n=ln); for(x=1, n, v=concat(v, tmp[x]); ); return(v) }
%o A125525 right(str, n) = /* Get the right n characters from string str.*/ { my(v, ln, s, x); v =""; tmp = Vec(str); ln=length(tmp); if(n > ln, n=ln); s = ln-n+1; for(x=s, ln, v=concat(v, tmp[x]); ); return(v) }
%o A125525 /* Political primes, Centrist case */ rep(n) = { my(x,ln,y,lp,rp); forprime(x=2,n, y=Str(x); if(x > 9, ln=floor(length(y)/2), ln=1); lp = eval(left(y,ln)); rp = eval(right(y,ln)); if(isprime(lp)&& isprime(rp),print1(x",") ) ) }
%Y A125525 Cf. A125523, A125524.
%K A125525 base,easy,nonn
%O A125525 1,1
%A A125525 _Cino Hilliard_, Jan 22 2007
%E A125525 Offset changed to 1 by _Zak Seidov_, Feb 19 2015