OFFSET
0,1
EXAMPLE
a(0) = 4 because 3^0 + 3 = 4 = A001358(1) and no semiprime is closer to 3^0.
a(1) = 4 because 3^1 + 1 = 4 = A001358(1) and no semiprime is closer to 3^1.
a(2) = 9 because 3^2 + 0 = 9 = 3^2 = A001358(3), no semiprime is closer to 3^2.
a(3) = 26 because 3^3 - 1 = 26 = 2 * 13, no semiprime is closer.
a(4) = 82 because 3^4 + 1 = 82 = 2 * 41, no semiprime is closer.
a(5) = 247 because 3^5 + 4 = 247 = 13 * 19, no semiprime is closer.
MATHEMATICA
nsp[n_]:=Module[{c=3^n, a, b, j=1, k=1}, While[PrimeOmega[c-j]!=2, j++]; a=c-j; While[ PrimeOmega[ c+k]!=2, k++]; b=c+k; If[(b-c)<(c-a), b, a]]; Join[ {4, 4, 9}, Array[nsp, 30, 3]] (* Harvey P. Dale, Apr 11 2015 *)
CROSSREFS
KEYWORD
easy,nonn,less
AUTHOR
Jonathan Vos Post, Mar 13 2006
STATUS
approved