|
COMMENTS
|
n=1,{3}!-3.
n=2,{4,5}!-7.
n=3,{4,5,6}!-11.
n=4,{9,10,11,12}!-17.
n=5,{22,23,24,25,26}!-191.
n=6,{12,13,14,15,16,17}!-50377.
n=7,{11,12,13,14,15,16,17}!-92761.
n=8,{10,12,13,14,15,16,17}!-2085737.
n=9,{11,12,13,14,15,16,17,18,19}!-30357947.
n=10,{16,17,18,19,20,21,22,23,24,25}!-1165922581.
n=11,{14,15,16,17,18,19,20,21,22,23,24}!-8547418259.
n=12,{15,16,17,18,19,20,21,22,23,24,25,26}!-35368198867.
|
|
MATHEMATICA
|
t[n_] :=
Module[{m = 0, s = {}},
For[k = 1, k < 20, k++, If[k! > n && PrimeQ[k! - n], m++;
AppendTo[s, k]; ]]; {Length@s, n, s,
Minus[Subtract @@@ Partition[s, 2, 1]]}];
a[n_] :=
If[n == 1, 3, For[r = 1, r <= 10^5, r++, s = Prime@r; v = t[s];
If[v[[1]] > 0 && SequenceCount[v[[4]], PadLeft[{}, n - 1, 1]] > 0,
Return[v[[2]]]; ]]]
Table[a[n], {n, 7}]
|