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.

A105184 Primes that can be written as concatenation of two primes in decimal representation.

This page as a plain text file.
%I A105184 #29 Dec 03 2024 12:45:12
%S A105184 23,37,53,73,113,137,173,193,197,211,223,229,233,241,271,283,293,311,
%T A105184 313,317,331,337,347,353,359,367,373,379,383,389,397,433,523,541,547,
%U A105184 571,593,613,617,673,677,719,733,743,761,773,797,977,1013,1033,1093
%N A105184 Primes that can be written as concatenation of two primes in decimal representation.
%C A105184 Primes that can be written as the concatenation of two distinct primes is the same sequence.
%C A105184 Number of terms < 10^n: 0, 4, 48, 340, 2563, 19019, 147249, ... - _T. D. Noe_, Oct 04 2010
%C A105184 The second prime cannot begin with the digit zero, else 307 would be the first additional term. - _Michael S. Branicky_, Sep 01 2024
%H A105184 T. D. Noe, <a href="/A105184/b105184.txt">Table of n, a(n) for n=1..10000</a>
%e A105184 193 is in the sequence because it is the concatenation of the primes 19 and 3.
%e A105184 197 is in the sequence because it is the concatenation of the primes 19 and 7.
%e A105184 199 is not in the sequence because there is no way to break it into two substrings such that both are prime: neither 1 nor 99 is prime, and 19 is prime but 9 is not.
%t A105184 searchMax = 10^4; Union[Reap[Do[p = Prime[i]; q = Prime[j]; n = FromDigits[Join[IntegerDigits[p], IntegerDigits[q]]]; If[PrimeQ[n], Sow[n]], {i, PrimePi[searchMax/10]}, {j, 2, PrimePi[searchMax/10^Ceiling[Log[10, Prime[i]]]]}]][[2, 1]]] (* _T. D. Noe_, Oct 04 2010 *)
%t A105184 Select[Prime@Range@1000,
%t A105184  MatchQ[IntegerDigits@#, {x__, y__} /;
%t A105184     PrimeQ@FromDigits@{x} && First@{y} != 0 &&
%t A105184 PrimeQ@FromDigits@{y}] &] (* _Hans Rudolf Widmer_, Nov 30 2024 *)
%o A105184 (Python)
%o A105184 from sympy import isprime
%o A105184 def ok(n):
%o A105184     if not isprime(n): return False
%o A105184     s = str(n)
%o A105184     return any(s[i]!="0" and isprime(int(s[:i])) and isprime(int(s[i:])) for i in range(1, len(s)))
%o A105184 print([k for k in range(1100) if ok(k)]) # _Michael S. Branicky_, Sep 01 2024
%Y A105184 Subsequence of A019549.
%Y A105184 Cf. A121608, A121609, A121610, A083427, A129800.
%K A105184 nonn,base
%O A105184 1,1
%A A105184 _Lekraj Beedassy_, Apr 11 2005
%E A105184 Corrected and extended by _Ray Chandler_, Apr 16 2005
%E A105184 Edited by _N. J. A. Sloane_, May 03 2007
%E A105184 Edited by _N. J. A. Sloane_, to remove erroneous b-file, comments and Mma program, Oct 04 2010