OFFSET
0,1
COMMENTS
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).
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
EXAMPLE
a(5) = 15 because 15 = 3*5 is a semiprime and ends in 5.
MAPLE
f:= proc(n) local x, d;
if (n mod 4 = 0 and n > 10) or (n mod 10 = 0) or (n mod 25 = 0) then return -1 fi;
d:= 10^(1+ilog10(n));
for x from n by d do
if numtheory:-bigomega(x) = 2 then return x fi
od
end proc:
f(0):= 10:
f(10):= 10:
f(25):= 25:
map(f, [$1..100]);
CROSSREFS
KEYWORD
AUTHOR
Zak Seidov and Robert Israel, Jul 22 2024
STATUS
approved