%I #15 Jul 24 2024 17:33:38
%S 10,21,22,33,4,15,6,57,38,9,10,111,-1,213,14,15,-1,217,118,119,-1,21,
%T 22,123,-1,25,26,327,-1,129,-1,731,-1,33,34,35,-1,237,38,39,-1,141,
%U 142,143,-1,145,46,247,-1,49,-1,51,-1,253,254,55,-1,57,58,159,-1,161,62,763,-1,65,166,267,-1,69
%N a(n) is the least semiprime that ends with n, or -1 if there is no such semiprime.
%C a(n) = -1 if n > 10 and n is divisible by 4 or 10, or n > 25 and n is divisible by 25. Otherwise a(n) > 0 (which can be proven using Dirichlet's theorem on primes in arithmetic progressions).
%H Robert Israel, <a href="/A374897/b374897.txt">Table of n, a(n) for n = 0..10000</a>
%e a(5) = 15 because 15 = 3*5 is a semiprime and ends in 5.
%p f:= proc(n) local x,d;
%p if (n mod 4 = 0 and n > 10) or (n mod 10 = 0) or (n mod 25 = 0) then return -1 fi;
%p d:= 10^(1+ilog10(n));
%p for x from n by d do
%p if numtheory:-bigomega(x) = 2 then return x fi
%p od
%p end proc:
%p f(0):= 10:
%p f(10):= 10:
%p f(25):= 25:
%p map(f, [$1..100]);
%Y Cf. A001358, A070277, A374899.
%K sign,base,look
%O 0,1
%A _Zak Seidov_ and _Robert Israel_, Jul 22 2024