OFFSET
1,1
COMMENTS
Numbers k not divisible by 3 such that A087555(k) = 0.
If x has d digits, the concatenation of k - x and x is divisible by GCD(k, 10^d-1). Thus if k has m digits and GCD(k, 10^d-1) > 1 for all d from 2 to m, the only possibility for the concatenation of k - x and x to be prime is when x has a single digit.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..136
EXAMPLE
a(3) = 110297 is a term: 110297 = 11 * 37 * 271 so GCD(110297, 10^d-1) > 1 for d = 2,3,4,5,6. The only possible x for which the concatenation of 110297 - x and x might be prime are the single digits 1, 3, 7 and 9, but none of 1102961, 1102943, 1102907 and 1102889 are prime.
MAPLE
tcat:= (a, b) -> a*10^(1+ilog10(b))+b:
filter:= proc(n) local d, x;
if n mod 3 = 0 then return false fi;
for d from 1 to 1+ilog10(n) do
if igcd(n, 10^d-1) > 1 then next fi;
for x from `if`(d=1, 1, 10^(d-1)+1) to 10^d-1 by 2 do
if isprime(tcat(n-x, x)) then return false fi;
od
od;
true
end proc:
select(filter, [$2 .. 2 * 10^8]);
PROG
(Python)
from gmpy2 import is_prime, mpz, digits
def ok(n): return n%3!=0 and not any(is_prime(mpz(digits(n-j)+digits(j))) for j in range(1, n, 2))
print([k for k in range(2, 10**6) if ok(k)]) # Michael S. Branicky, Sep 03 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Sep 03 2024
STATUS
approved