This site is supported by donations to The OEIS Foundation.

 Annual Appeal: Please make a donation to keep the OEIS running. In 2018 we replaced the server with a faster one, added 20000 new sequences, and reached 7000 citations (often saying "discovered thanks to the OEIS"). Other ways to donate

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A117406 Integer k such that 2^n + k = A117405(n). 5
 3, 2, 0, 1, -1, 1, 1, 1, -2, -1, 3, -1, 1, 1, -2, -3, -5, 1, -2, 1, 1, -3, 7, -1, 3, -3, 3, 3, 1, 6, -3, 1, 1, -3, -3, -3, -3, -1, 18, 3, 1, -1, 3, 1, -3, 3, 7, -9, 3, -1, 7, -5, 3, 11, -3, -5, 6, -9, -3, -1, -3, 1, -2, 9, 1, 5, 3, -1, -5, -13, 9, -3, -7, -3 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,1 COMMENTS After n=2, never again is a(n) = 0. Semiprime analog of A117388 Integer k such that 2^n + k = A117387(n). A117387(n) is prime nearest to 2^n. (In case of a tie, choose the smaller). LINKS FORMULA a(n) = A117405(n) - 2^n. a(n) = Min{k such that A001358(i) + k = 2^j}. EXAMPLE a(0) = 3 because 2^0 + 3 = 4 = A001358(1) and no semiprime is closer to 2^0. a(1) = 2 because 2^1 + 2 = 4 = A001358(1) and no semiprime is closer to 2^1. a(2) = 0 because 2^2 + 0 = 4 = A001358(1) and no semiprime is closer to 2^2. a(3) = 1 because 2^3 + 1 = 9 = 3^2 = A001358(3), no semiprime is closer to 2^3. a(4) = -1 because 2^4 - 1 = 15 = 3 * 5 and no semiprime is closer. a(5) = 1 because 2^5 + 1 = 33 = 3 * 11 and no semiprime is closer to 2^5. a(6) = 1 because 2^6 + 1 = 65 = 5 * 13 and no semiprime is closer to 2^6. a(7) = 1 because 2^7 + 1 = 129 = 3 * 43 and no semiprime is closer to 2^7. a(8) = -2 because 2^8 - 2 = 254 = 2 * 127 and no semiprime is closer to 2^8. MATHEMATICA a[n_] := Catch@Block[{p = 2^n, k = 0}, While[True, If[p > k && PrimeOmega[p - k] == 2, Throw[-k]]; If[PrimeOmega[p + k] == 2, Throw[k]]; k++]]; a /@ Range[0, 80] a /@ Range[0, 80] (* Giovanni Resta, Jun 15 2016 *) CROSSREFS Cf. A000079, A001358, A117387, A117405. Sequence in context: A138741 A116604 A303913 * A290216 A293202 A280265 Adjacent sequences:  A117403 A117404 A117405 * A117407 A117408 A117409 KEYWORD easy,sign,less AUTHOR Jonathan Vos Post, Mar 13 2006 EXTENSIONS Corrected and extended by Giovanni Resta, Jun 15 2016 STATUS approved

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

Last modified December 17 14:50 EST 2018. Contains 318201 sequences. (Running on oeis4.)