

A117416


Semiprime nearest to 3^n. In case of a tie, choose the smaller.


4



4, 4, 9, 26, 82, 247, 731, 2186, 6559, 19679, 59047, 177149, 531439, 1594322, 4782979, 14348905, 43046722, 129140159, 387420493, 1162261465, 3486784399, 10460353201, 31381059597, 94143178823, 282429536489, 847288609441
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,1


COMMENTS

See also: A117405 Semiprime nearest to 2^n. A117387 Prime nearest to 2^n.


LINKS

Table of n, a(n) for n=0..25.


FORMULA

a(n) = 3^n + A117416(n). a(n) = 3^n + Min{k such that A001358(i) + k = 3^n}.


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[cj]!=2, j++]; a=cj; While[PrimeOmega[c+k]!=2, k++]; b=c+k; If[(bc)<(ca), b, a]]; Join[ {4, 4, 9}, Array[nsp, 30, 3]] (* Harvey P. Dale, Apr 11 2015 *)


CROSSREFS

Cf. A000079, A001358, A117387, A117405, A117406, A117416.
Sequence in context: A069549 A118069 A089539 * A174943 A173317 A059811
Adjacent sequences: A117413 A117414 A117415 * A117417 A117418 A117419


KEYWORD

easy,nonn,less


AUTHOR

Jonathan Vos Post, Mar 13 2006


STATUS

approved



