OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..5803
EXAMPLE
a(5) = 97 is a term because it is prime and 97 + 1 = 98 is the concatenation of 3^2 = 9 and 2^3 = 8.
MAPLE
M:= 10: # for terms with <= M digits
R:= NULL:
for i from 0 while 3^i < 10^(M-1) do
d:= 1+ilog10(3^i);
for j from 1 while 2^j < 10^(M-d) do
x:= dcat(3^i, 2^j)-1;
if isprime(x) then R:= R, x fi
od od:
sort([R]);
PROG
(Python)
from sympy import isprime
from itertools import count, takewhile
def auptod(digits):
M = 10**digits
pows2 = list(takewhile(lambda x: x < M , (2**a for a in count(0))))
pows3 = list(takewhile(lambda x: x < M , (3**b for b in count(0))))
strs2, strs3 = list(map(str, pows2)), list(map(str, pows3))
concat = (int(s3+s2) for s3 in strs3 for s2 in strs2)
return sorted(set(t-1 for t in concat if t < M and isprime(t-1)))
print(auptod(10)) # Michael S. Branicky, Aug 16 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Aug 16 2022
STATUS
approved