login
A387526
Positive numbers k with property that by doubling a substring in place we get a prime.
2
1, 13, 19, 21, 23, 27, 31, 37, 43, 49, 51, 53, 57, 59, 67, 79, 83, 87, 91, 111, 113, 117, 119, 121, 123, 127, 129, 133, 137, 139, 141, 143, 151, 153, 157, 159, 163, 169, 171, 177, 179, 181, 183, 187, 191, 193, 197, 199, 201, 209, 211, 213, 217, 219, 221, 223, 229
OFFSET
1,2
COMMENTS
Take the decimal expansion of k, say k = d_1 d_2 ... d_m. We can choose to map it to any number that can be obtained by the following process. Take any substring d_i, d_{i+1}..., d_j that does not begin with 0, and replace it by double the number it represents. If the result is a prime, k is in the sequence. Clearly, k must be odd, and may not end in a 5.
LINKS
EXAMPLE
21 is a term because 41 is a prime. 113 is a term because 223 is a prime.
151 is a term because 251 is a prime, 153 because of 1103, 157 because of 257, and 159 because of 1109.
MATHEMATICA
A387526Q[k_] := k == 1 || (OddQ[k] && !Divisible[k, 5] && Catch[With[{d = IntegerDigits[k]}, Do[If[d[[s]] > 0 && AnyTrue[Range[s, Length[d]-1], PrimeQ[FromDigits[Join[d[[;; s-1]], IntegerDigits[FromDigits[d[[s ;; #]]]*2], d[[#+1 ;; ]]]]] &], Throw[True]], {s, Length[d]-1}]; False]]);
Select[Range[300], A387526Q] (* Paolo Xausa, Oct 02 2025 *)
PROG
(Python)
from sympy import isprime
def ok(n):
if n%10 not in {1, 3, 7, 9}: return False
s = str(n)
return any(isprime(int(s[:i]+str(2*int(s[i:j]))+s[j:])) for i in range(len(s)) for j in range(i+1, len(s)+1) if s[i]!='0')
print([k for k in range(230) if ok(k)]) # Michael S. Branicky, Sep 30 2025
CROSSREFS
Cf. A000040. Suggested by the "Choix de Bruxelles" sequence A323286.
Sequence in context: A216639 A350301 A171098 * A349762 A118845 A050717
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Sep 30 2025
EXTENSIONS
More terms from Michael S. Branicky, Sep 30 2025
STATUS
approved