OFFSET
1,1
COMMENTS
It appears that a(n) exists for any n.
a(41) = 42264532659, a(42) = 34279038379, a(45) = 58898255693, a(47) = 70265467489, and a(50) = 49167925231. - Charles R Greathouse IV, Dec 07 2016
LINKS
Dana Jacobsen, Table of n, a(n) for n = 1..55 (first 39 terms from Charles R Greathouse IV)
EXAMPLE
PROG
(PARI) issemi(n)=bigomega(n)==2
nextsemi(n)=while(!issemi(n), n++); n
listsemi(a, b)=my(v=List()); if(a<4, a=4); forprime(p=sqrtint(a-1)+1, b\2, forprime(q=(a-1)\p+1, min(b\p, p), listput(v, p*q))); Set(v)
list(lim)=
{
lim=nextsemi(ceil(lim));
my(foundsemi=[0], small=listsemi(4, max(sqrtint(lim), 4)), v=small, lastsmall=small[#small], needed=4);
while(v[1]<lim,
for(i=2, #v,
my(g=v[i]-v[i-1], idx);
if(g<needed, next);
if(g>lastsmall,
small=listsemi(4, max(2*lastsmall, g));
lastsmall=small[#small]
);
idx=setsearch(small, g);
if(!idx, next);
if(idx>#foundsemi,
foundsemi=concat(foundsemi, vector(idx-#foundsemi));
);
if(foundsemi[idx]==0,
foundsemi[idx]=v[i-1];
if(needed==g,
for(j=idx, #foundsemi,
if(foundsemi[j]==0, break);
needed=small[j+1];
)
);
)
);
v=listsemi(v[#v], min(nextsemi(v[#v]+10^7), lim));
);
for(i=1, #foundsemi,
if(foundsemi[i]==0, return(foundsemi[1..i-1]))
);
foundsemi;
} \\ Charles R Greathouse IV, Nov 19 2016
(Perl) use ntheory ":all";
my($l, $nxti, $nxt, @G)=(4, 1, 4);
forsemiprimes {
if (!exists $G[$_-$l]) {
$G[$_-$l]=$l;
while (exists $G[$nxt]) {
print "$nxti $G[$nxt]\n";
$nxt=nth_semiprime(++$nxti);
}
}
$l=$_;
} 5, 1e8; # Dana Jacobsen, Oct 16 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Nov 19 2016
EXTENSIONS
a(14) and a(19) corrected by Charles R Greathouse IV, Nov 19 2016
a(27)-a(35) from Charles R Greathouse IV, Nov 19 2016
a(36)-a(38) from Charles R Greathouse IV, Nov 22 2016
STATUS
approved