|
|
A037019
|
|
Let n = p_1*p_2*...*p_k be the prime factorization of n, with the primes sorted in descending order. Then a(n) = 2^(p_1 - 1)*3^(p_2 - 1)*...*A000040(k)^(p_k - 1).
|
|
19
|
|
|
1, 2, 4, 6, 16, 12, 64, 30, 36, 48, 1024, 60, 4096, 192, 144, 210, 65536, 180, 262144, 240, 576, 3072, 4194304, 420, 1296, 12288, 900, 960, 268435456, 720, 1073741824, 2310, 9216, 196608, 5184, 1260, 68719476736, 786432, 36864, 1680, 1099511627776
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
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]), `>`)):
|
|
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
(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))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,nice,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|