login
a(n) = smallest k such that prime(n) is the n-th largest divisor of k.
1

%I #13 Mar 25 2017 11:34:52

%S 2,6,20,42,154,156,306,836,552,1044,1488,2960,2460,3870,7050,12084,

%T 8496,10248,14070,12780,18396,31284,50796,38448,55872,82416,37080,

%U 51360,65400,88140,146304,169776,123300,133440,150192,181200,131880,176040,260520,326970

%N a(n) = smallest k such that prime(n) is the n-th largest divisor of k.

%H Charles R Greathouse IV, <a href="/A226326/b226326.txt">Table of n, a(n) for n = 1..200</a>

%e a(5) = 165 because the divisors of 165 are (165, 55, 33, 15, 11, 5, 3, 1) and prime(5) = 11 is the 5th divisor of 165.

%p with(numtheory):

%p a:= proc(n) local k, p; p:= ithprime(n);

%p for k from p by p while tau(k)<n or

%p sort([divisors(k)[]], `>`)[n]<>p do od; k

%p end:

%p seq(a(n), n=1..50); # _Alois P. Heinz_, Jun 04 2013

%t a[n_] := Module[{k, p}, p = Prime[n]; For[k = p, DivisorSigma[0, k] < n || Reverse[Divisors[k]][[n]] != p, k = k + p]; k];

%t Table[a[n], {n, 1, 50}] (* _Jean-François Alcover_, Mar 25 2017, after _Alois P. Heinz_ *)

%o (PARI) a(n)=my(p=prime(n),k,d);while(k+=p, d=divisors(k); if(#d>=n && d[#d-n+1]==p, return(k))) \\ _Charles R Greathouse IV_, Jun 04 2013

%Y Cf. A225562.

%K nonn

%O 1,1

%A _Irina Gerasimova_, Jun 04 2013

%E a(5) corrected, a(6)-a(40) from _Charles R Greathouse IV_, Jun 04 2013