login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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
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[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
Sequence in context: A118069 A089539 A324010 * A174943 A173317 A059811
KEYWORD
easy,nonn,less
AUTHOR
Jonathan Vos Post, Mar 13 2006
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 2 08:59 EST 2024. Contains 370461 sequences. (Running on oeis4.)