login
In the interval [prime(n), 2*prime(n)], the greatest k with the maximal number of divisors.
2

%I #16 May 17 2016 09:22:31

%S 4,6,10,12,20,24,30,36,36,48,60,72,72,84,90,96,108,120,120,120,120,

%T 120,120,168,180,180,180,180,180,180,240,240,240,240,240,240,240,240,

%U 240,336,336,360,360,360,360,360,420,420,420,420

%N In the interval [prime(n), 2*prime(n)], the greatest k with the maximal number of divisors.

%C The different values of the sequence are union of highly composite numbers (A002182, n>=3) and the numbers {10, 20, 30, 72, 84, 90, 96, 108, 168, 336, 420,...}.

%H Peter J. C. Moses, <a href="/A272777/b272777.txt">Table of n, a(n) for n = 1..1000</a>

%e Let n=5, prime(n)=11. In interval [11,22] we have 3 numbers 12,18 and 20 with the maximal number of divisors in this interval(6). Since 20 is the most of them, then a(5)=20.

%t Table[First@ MaximalBy[Reverse@ Range[Prime@ n, 2 Prime@ n], DivisorSigma[0, #] &], {n, 50}] (* _Michael De Vlieger_, May 09 2016, Version 10 *)

%o (PARI) a(n) = {my(nb = 2*prime(n) - prime(n) + 1, vd = vector(nb, i, numdiv(prime(n)+i-1)), vmax = vecmax(vd), k = nb); while (vd[k] != vmax, k--); k+prime(n)-1;} \\ _Michel Marcus_, May 07 2016

%Y Cf. A000005, A000040, A002182, A272771.

%K nonn

%O 1,1

%A _Vladimir Shevelev_, May 06 2016