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.

A380943 Primes written in decimal representation by the concatenation of primes p and q such that the concatenation of q and p also forms a prime.

This page as a plain text file.
%I A380943 #41 May 08 2025 23:10:27
%S A380943 37,73,113,173,197,311,313,317,331,337,359,367,373,593,617,673,719,
%T A380943 733,761,797,977,1093,1097,1123,1277,1319,1361,1373,1783,1913,1931,
%U A380943 1979,1997,2293,2297,2311,2347,2389,2713,2837,2971,3109,3119,3137,3191,3229,3271
%N A380943 Primes written in decimal representation by the concatenation of primes p and q such that the concatenation of q and p also forms a prime.
%C A380943 Member primes could be named Saint Patrick primes because the date of Saint Patrick's Day, March 17 (3/17), produces the terms 173 and 317.
%C A380943 The primes 37, 73, and 373 uniquely satisfy the requirements if cleaved at every possible position. - _Robert G. Wilson v_, May 03 2025
%H A380943 James C. McMahon, <a href="/A380943/b380943.txt">Table of n, a(n) for n = 1..1000</a>
%H A380943 Michael De Vlieger, <a href="/A380943/a380943.png">Plot a(n) = p<>q at (x,y) = (pi(p), pi(q))</a> showing all terms with pi(p) <= 40 and pi(q) <= 40, labeling p in red and q in blue.
%H A380943 Michael De Vlieger, <a href="/A380943/a380943_1.png">Plot a(n) = p<>q at (x,y) = (pi(p), pi(q))</a> showing all terms with pi(p) <= 2000 and pi(q) <= 2000.
%e A380943 Primes 173 and 317 are members because they are formed by the concatenation of 17 & 3  and 3 & 17, respectively.
%e A380943 While the concatenation of 13 and 7 forms the prime 137, it is not a member because the concatenation of 7 and 13 is 713, which is not prime.
%t A380943 lim=3300; plim=Max[FromDigits[Rest[IntegerDigits[lim]]], FromDigits[Drop[IntegerDigits[lim], -1]]]; p=Prime[Range[PrimePi[plim]]];p2=Subsets[p,{2}];fp[{a_,b_}]:=FromDigits[Join[IntegerDigits[a],IntegerDigits[b]]];rfp[{a_,b_}]:=FromDigits[Join[IntegerDigits[b],IntegerDigits[a]]];pabba=Select[p2,PrimeQ[fp[#]]&&PrimeQ[rfp[#]]&];pp1=fp/@pabba;pp2=rfp/@pabba;Select[Union[Join[pp1,pp2]],#<=lim&]
%o A380943 (Python)
%o A380943 from sympy import isprime
%o A380943 def ok(n):
%o A380943     if not isprime(n): return False
%o A380943     s = str(n)
%o A380943     return any(s[i]!='0' and isprime(int(s[:i])) and isprime(int(s[i:])) and isprime(int(s[i:]+s[:i])) for i in range(1, len(s)))
%o A380943 print([k for k in range(3300) if ok(k)]) # _Michael S. Branicky_, Apr 05 2025
%Y A380943 Subsequence of A019549 and A105184.
%Y A380943 Cf. A133187.
%K A380943 nonn,base
%O A380943 1,1
%A A380943 _James C. McMahon_, Apr 03 2025