OFFSET
0,1
LINKS
Robert Israel, Table of n, a(n) for n = 0..111
FORMULA
a(n) = 5^n + A117430(n).
EXAMPLE
a(0) = 4 because 5^0 + 3 = 4 = A001358(1) and no semiprime is closer to 5^0.
a(1) = 4 because 5^1 - 1 = 4 = A001358(1) and no semiprime is closer to 5^1.
a(2) = 25 because 5^2 + 0 = 25 = A001358(9), no semiprime is closer to 5^2.
a(3) = 123 because 5^3 - 2 = 123 = 3 * 41 = A001358(42), no semiprime is closer.
a(4) = 626 because 5^4 + 1 = 626 = 2 * 313, no semiprime is closer.
a(5) = 3127 because 5^5 + 2 = 3127 = 53 * 59, no semiprime is closer.
a(6) = 15623 because 5^6 - 2 = 15623 = 17 * 919, no semiprime is closer.
a(7) = 78123 because 5^7 - 2 = 78123 = 3 * 26041, no semiprime is closer.
a(8) = 390623 because 5^8 - 2 = 390623 = 73 * 5351, no semiprime is closer.
a(9) = 1953122 because 5^9 - 3 = 1953122 = 2 * 976561, no semiprime is closer.
a(10) = 9765627 because 5^10 + 2 = 9765627 = 3 * 3255209, no semiprime closer.
MAPLE
nsp:= proc(n) uses numtheory; local k;
if bigomega(n)=2 then return n fi;
for k from 1 do
if n-k > 0 and bigomega(n-k)=2 then return n-k fi;
if bigomega(n+k)=2 then return n+k fi
od
end proc:
seq(nsp(5^k), k=0..30); # Robert Israel, May 03 2018
MATHEMATICA
sp1[n_]:=Module[{k=0}, While[PrimeOmega[n-k]!=2, k++]; n-k]; sp2[n_]:= Module[ {k=1}, While[ PrimeOmega[n+k]!=2, k++]; n+k]; Join[{4}, Nearest[ {sp1[#], sp2[#]}, #][[1]]&/@(5^Range[20])] (* Harvey P. Dale, Aug 11 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jonathan Vos Post, Mar 14 2006
EXTENSIONS
Edited by Robert Israel, May 03 2018
STATUS
approved