OFFSET
1,2
COMMENTS
This is an easy way to produce a number with exactly n divisors and it usually produces the smallest such number (A005179(n)). The references call n "ordinary" if A005179(n) = a(n) and "exceptional" or "extraordinary" otherwise. - David Wasserman, Jun 12 2002
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
R. Brown, The minimal number with a given number of divisors, Journal of Number Theory 116 (2006) 150-158.
M. E. Grost, The smallest number with a given number of divisors, Amer. Math. Monthly, 75 (1968), 725-729.
Anna K. Savvopoulou and Christopher M. Wedrychowicz, On the smallest number with a given number of divisors, The Ramanujan Journal, 2015, Vol. 37, pp. 51-64.
EXAMPLE
12 = 3*2*2, so a(12) = 2^2*3*5 = 60.
MAPLE
a:= n-> (l-> mul(ithprime(i)^(l[i]-1), i=1..nops(l)))(
sort(map(i-> i[1]$i[2], ifactors(n)[2]), `>`)):
seq(a(n), n=1..60); # Alois P. Heinz, Feb 28 2019
MATHEMATICA
(Times@@(Prime[ Range[ Length[ # ] ] ]^Reverse[ #-1 ]))&@Flatten[ FactorInteger[ n ]/.{ a_Integer, b_}:>Table[ a, {b} ] ]
PROG
(Haskell)
a037019 = product .
zipWith (^) a000040_list . reverse . map (subtract 1) . a027746_row
-- Reinhard Zumkeller, Nov 25 2012
(PARI) A037019(n, p=1)=prod(i=1, #f=Vecrev(factor(n)~), prod(j=1, f[i][2], (p=nextprime(p+1))^(f[i][1]-1))) \\ M. F. Hasler, Oct 14 2014
(Python)
from math import prod
from sympy import factorint, prime
def a(n):
pf = factorint(n, multiple=True)
return prod(prime(i)**(pi-1) for i, pi in enumerate(pf[::-1], 1))
print([a(n) for n in range(1, 42)]) # Michael S. Branicky, Jul 24 2022
CROSSREFS
KEYWORD
nonn,nice,easy
AUTHOR
EXTENSIONS
More terms from David Wasserman, Jun 12 2002
STATUS
approved