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.

A133187 Prime numbers formed by the concatenation of q and p, where q > p are also primes.

This page as a plain text file.
%I A133187 #24 Apr 05 2025 15:12:30
%S A133187 53,73,113,137,173,193,197,233,293,313,317,373,433,593,613,617,673,
%T A133187 677,733,797,977,1013,1033,1093,1097,1277,1373,1493,1637,1733,1913,
%U A133187 1933,1973,1993,1997,2113,2237,2273,2293,2297,2311,2333,2393,2417,2633,2693,2713
%N A133187 Prime numbers formed by the concatenation of q and p, where q > p are also primes.
%C A133187 These numbers are called Caesar primes because the birth date of Julius Caesar (July 13th) provides one example of such a number, i.e. p=7 and q=13 give the prime 137.
%H A133187 Michael S. Branicky, <a href="/A133187/b133187.txt">Table of n, a(n) for n = 1..10000</a>
%t A133187 lim=2700;plim=Max[FromDigits[Rest[IntegerDigits[lim]]],FromDigits[Drop[IntegerDigits[lim],-1]]];f2p[{p_,q_}]:=FromDigits[Join[IntegerDigits[q],IntegerDigits[p]]];p=Prime[Range[PrimePi[plim]]];p2=Subsets[p,{2}];Union[Select[f2p/@p2,PrimeQ[#]&&#<=lim&]] (* _James C. McMahon_, Mar 12 2025 *)
%o A133187 (Python)
%o A133187 from sympy import isprime
%o A133187 def ok(n):
%o A133187     if not isprime(n): return False
%o A133187     s = str(n)
%o A133187     return any(s[i]!='0' and (q:=int(s[:i])) > (p:=int(s[i:])) and isprime(q) and isprime(p) for i in range(1, len(s)))
%o A133187 print([k for k in range(2800) if ok(k)]) # _Michael S. Branicky_, Apr 05 2025
%Y A133187 Cf.  A019549, A105184.
%K A133187 base,nonn
%O A133187 1,1
%A A133187 Tom Mueller (muel4503(AT)uni-trier.de), Dec 17 2007
%E A133187 a(27)-a(47) from _James C. McMahon_, Mar 12 2025