login
A376332
a(n) is the least k such that k - i! is a semiprime for all i from 1 to n.
0
5, 11, 16, 135, 135, 923, 6083, 71663, 423959, 3995879, 43216583, 489118019, 6233987183, 87199150463, 1310334397523, 20937254735843, 355693511854763
OFFSET
1,1
COMMENTS
a(n) == 3 (mod 4) for n > 3.
a(18) > 6 * 10^11 + 18!, if it exists. - Daniel Suteu, Oct 24 2024
EXAMPLE
a(5) = 135 because 135 - 1! = 134 = 2*67, 135 - 2! = 133 = 7 * 19, 135 - 3! = 129 = 3 * 43, 135 - 4! = 111 = 3 * 39 and 135 - 5! = 15 = 3 * 5 are all semiprimes, and no number smaller than 135 works.
MAPLE
f:= proc(n) local F, k, i;
F:= [seq(i!, i=1..n)];
for k from n! + 4 do
if andmap(t -> numtheory:-bigomega(k-t) = 2, F) then return k fi
od
end proc:
map(f, [$1..13]);
MATHEMATICA
a[n_]:=Module[{k=n!+1}, While[Product[Boole[PrimeOmega[k-i!]==2], {i, n}]!=1, k++]; k]; Array[a, 9] (* Stefano Spezia, Sep 20 2024 *)
PROG
(PARI) a(n) = if(n <= 3, return([5, 11, 16][n])); my(N=n!, F=vector(n, i, (n - i + 1)!)); forprime(p = N>>1, oo, my(k=2*p+1, ok=1); for(i=1, n, if(bigomega(k - F[i]) != 2, ok=0; break)); ok && return(k)); \\ Daniel Suteu, Oct 24 2024
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Robert Israel, Sep 20 2024
EXTENSIONS
a(15)-a(17) from Daniel Suteu, Oct 24 2024
STATUS
approved