A246463 a(n) = min(p +- q) > 1 with p*q being equal to the n-th primorial (A002110).
5, 7, 11, 13, 17, 107, 41, 157, 1811, 1579, 18859, 95533, 17659, 1995293, 208303, 2396687, 58513111, 299808329, 3952306763, 341777053, 115405393057, 437621467859, 1009861675153, 6660853109087, 29075165225531, 418895584426457, 2371362636817019, 6889206780487667, 5258351738694673
Offset: 2
Keywords
Examples
a(7) = 41 since the middle four divisors of 7# or 2*3*5*7*11*13*17 = 510510 are 663, 714, 715 and 770. Because the middle two only differ by 1, the next pair, 663 and 770 are used and their difference is 107. a(8) = 41 since the middle two divisors of 8# are 3094 and 3135 which have a difference of 41.
Programs
-
Mathematica
f[n_] := Block[{k = mx = 1, fi = Prime@ Range@ n, prod = Fold[Times, 1, Prime@ Range@ n], sqrt, tms}, sqrt = Floor@ Sqrt@ prod; While[k < 2^n, tms = Times @@ (fi^IntegerDigits[k, 2, n]); If[mx < tms < sqrt, mx = tms]; k++]; prod/mx - mx]; Array[f, 30, 2]
-
PARI
a(n)=my(P=prod(i=1,n,prime(i)));forstep(k=sqrtint(P),1,-1,if(P%k==0 && P/k-k>1, return(P/k-k))) \\ Charles R Greathouse IV, Aug 31 2014
-
PARI
a(n)=my(P=prod(i=1,n,prime(i)),t); fordiv(P,d, if(P/d-d>1, t=P/d-d, return(t))) \\ Charles R Greathouse IV, Aug 31 2014
Comments