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
Michael S. Branicky, Table of n, a(n) for n = 1..10000
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
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Sep 30 2025
EXTENSIONS
More terms from Michael S. Branicky, Sep 30 2025
STATUS
approved
