%I #9 Jun 15 2016 10:33:25
%S 3,1,0,-1,1,4,2,-1,-2,-4,-2,2,-2,-1,10,-2,1,-4,4,-2,-2,-2,-12,-4,8,-2,
%T -7,2,-2,8,14,-5,1,-4,-8,-4,16,6,-6,-2,2,-8,-2,12,-2,-5,-8,10,-2,4,
%U -10,40,8,-10,4,-2,-34,-2,4,-20,-2
%N Integer k such that 3^n + k = A117416(n).
%C Distance from 3^n to the nearest semiprime. If there are two semiprimes at the same distance, take the negative k-value.
%C See also: A117405 Semiprime nearest to 2^n. A117387 Prime nearest to 2^n.
%F a(n) = Integer k such that 3^n + k = A117416(n). a(n) = A117416(n) - 3^n. a(n) = Min{k such that A001358(i) + k = 3^n}.
%e a(0) = 3 because 3^0 + 3 = 4 = A001358(1) and no semiprime is closer to 3^0.
%e a(1) = 1 because 3^1 + 1 = 4 = A001358(1) and no semiprime is closer to 3^1.
%e a(2) = 0 because 3^2 + 0 = 9 = 3^2 = A001358(3), no semiprime is closer to 3^2 [this is the only 0 element].
%e a(3) = -1 because 3^3 - 1 = 26 = 2 * 13, no semiprime is closer.
%e a(4) = 1 because 3^4 + 1 = 82 = 2 * 41, no semiprime is closer.
%e a(5) = 4 because 3^5 + 4 = 247 = 13 * 19, no semiprime is closer.
%Y Cf. A000079, A001358, A117387, A117405, A117406, A117416.
%K easy,sign,less
%O 0,1
%A _Jonathan Vos Post_, Mar 13 2006
|