OFFSET
1,2
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
FORMULA
In prime factorization of n, replace most common prime by 2, next most common by 3, etc.
EXAMPLE
If p,q,... are different primes, a(p)=2, a(p^2)=4, a(pq)=6, a(p^2*q)=12, etc.
n = 108 = 2*2*3*3*3 is replaced by a(n) = 2*2*2*3*3 = 72;
n = 105875 = 5*5*5*7*11*11 is represented by a(n) = 2*2*2*3*3*5 = 360.
Prime-powers are replaced by corresponding powers of 2, primes by 2.
Factorials, primorials and lcm[1..n] are in the sequence.
MAPLE
a:= n-> (l-> mul(ithprime(i)^l[i][2], i=1..nops(l)))
(sort(ifactors(n)[2], (x, y)->x[2]>y[2])):
seq(a(n), n=1..100); # Alois P. Heinz, Aug 18 2014
MATHEMATICA
Table[Apply[Times, p[w]^Reverse[Sort[ex[w]]]], {w, 1, 1000}] p[x_] := Table[Prime[w], {w, 1, lf[x]}] ex[x_] := Table[Part[ffi[x], 2*w], {w, 1, lf[x]}] ffi[x_] := Flatten[FactorInteger[x]] lf[x_] := Length[FactorInteger[x]]
ps[n_] := Sort[Last /@ FactorInteger[n]]; Join[{1}, Table[i = 2; While[ps[n] != ps[i], i++]; i, {n, 2, 89}]] (* Jayanta Basu, Jun 27 2013 *)
PROG
(PARI) a(n)=my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]) \\ Charles R Greathouse IV, Aug 17 2011
(PARI) A046523(n)=factorback(primes(#n=vecsort(factor(n)[, 2], , 4)), n) \\ M. F. Hasler, Oct 12 2018, improved Jul 18 2019
(Haskell)
import Data.List (sort)
a046523 = product .
zipWith (^) a000040_list . reverse . sort . a124010_row
-- Reinhard Zumkeller, Apr 27 2013
(Python)
from sympy import factorint
def P(n):
f = factorint(n)
return sorted([f[i] for i in f])
def a(n):
x=1
while True:
if P(n) == P(x): return x
else: x+=1 # Indranil Ghosh, May 05 2017
(Python)
from math import prod
from sympy import factorint, prime
def A046523(n): return prod(prime(i+1)**e for i, e in enumerate(sorted(factorint(n).values(), reverse=True))) # Chai Wah Wu, Feb 04 2022
CROSSREFS
A025487 gives range of values of this sequence.
KEYWORD
nonn,easy,nice
AUTHOR
EXTENSIONS
Corrected and extended by Ray Chandler, Mar 11 2004
STATUS
approved