OFFSET
1,1
FORMULA
For n >= 2, a(n) = 2^(n-2) * 3 * (27 + 4 * (-1)^n).
EXAMPLE
a(3) = 138 because 138 = 2 * 3 * 23, 138 - a(2) = 45 = 3^2 * 5, and 138 + a(2) = 231 = 3 * 7 * 11 all have 3 prime divisors, counted by multiplicity.
MAPLE
f:= proc(n, a) # first n-almost-prime b>a such that b-a and a+b are n-almost-prime
uses priqueue;
local Aprimes, v, M, q, w, b;
M:= 10^1000;
initialize(Aprimes);
insert([-2^n, 0, 2], Aprimes);
do
v:= extract(Aprimes);
if v[2] = n then
b:= -v[1];
if numtheory:-bigomega(b+a)=n and numtheory:-bigomega(b-a) = n then return b fi
else
insert(v+[0, 1, 0], Aprimes);
q:= nextprime(v[3]);
w:= v[1]*(q/v[3])^(n-v[2]);
if w >= -M then insert([w, v[2], q], Aprimes) fi
fi
od
end proc:
R:= 2: a:= 2:
for n from 2 to 50 do
a:= f(n, a);
R:= R, a;
od:
R;
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Sep 21 2023
STATUS
approved