OFFSET
1,1
COMMENTS
a(n) ~ c * 3^n. - David A. Corneth, Jan 11 2019
LINKS
David A. Corneth, Table of n, a(n) for n = 1..801
EXAMPLE
a(1) = 3 as 3 + 2 = 5 (prime),
a(2) = 2 as 2 + 2 = 4 = 2*2 (semiprime),
a(3) = 43 as 43 + 2 = 45 = 3*3*5 (3-almost prime),
a(4) = 79 as 79 + 2 = 81 = 3*3*3*3 (4-almost prime).
MATHEMATICA
ptns[n_, 0] := If[n == 0, {{}}, {}]; ptns[n_, k_] := Module[{r}, If[n < k, Return[{}]]; ptns[n, k] = 1 + Union @@ Table[PadRight[#, k] & /@ ptns[n - k, r], {r, 0, k}]]; a[n_] := Module[{i, l, v}, v = Infinity; For[i = n, True, i++, l = (Times @@ Prime /@ # &) /@ ptns[i, n]; If[Min @@ l > v, Return[v]]; minp = Min @@ Select[l - 2, PrimeQ]; If[minp < v, v = minp]]] ; Array[a, 10] (* after Amarnath Murthy at A073919 *)
PROG
(PARI) a(n) = forprime(p=2, , if (bigomega(p+2) == n, return (p))); \\ Michel Marcus, Jan 10 2019
(PARI) a(n) = {my(p3 = 3^n, u, c); if(n <= 2, return(4 - n)); if(isprime(p3 - 2), return(p3 - 2)); forprime(p = 5, oo, if(isprime(p3 / 3 * p - 2), u = p3 / 3 * p - 2; break ) ); for(i = 2, n, if(p3 * (5/3)^i > u, return(u)); for(j = 1, oo, if(p3 * j \ 3^i > u, next(2)); if(bigomega(j) == i, if(isprime(p3 / 3^(i) * j - 2), u = p3 / 3^(i) * j - 2; next(2) ) ) ) ); return(u) } \\ David A. Corneth, Jan 11 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Amiram Eldar and Zak Seidov, Jan 10 2019
STATUS
approved