login
Multiplicative with a(p^e) = prime(p)^e.
28

%I #43 Mar 12 2021 15:55:18

%S 1,3,5,9,11,15,17,27,25,33,31,45,41,51,55,81,59,75,67,99,85,93,83,135,

%T 121,123,125,153,109,165,127,243,155,177,187,225,157,201,205,297,179,

%U 255,191,279,275,249,211,405,289,363,295,369,241,375,341,459,335,327

%N Multiplicative with a(p^e) = prime(p)^e.

%H Alois P. Heinz, <a href="/A064988/b064988.txt">Table of n, a(n) for n = 1..20000</a>

%H <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a> (first 1000 terms from Harry J. Smith)

%F From _Antti Karttunen_, Aug 08 & 22 2017: (Start)

%F For n = p_{i1} * p_{i2} * ... * p_{ik}, where the indices i1, i2, ..., ik of primes p are not necessarily distinct, a(n) = A006450(i1) * A006450(i2) * ... * A006450(ik).

%F a(n) = A003961(A290641(n)).

%F A046523(a(n)) = A046523(n). [Preserves the prime signature of n].

%F A003963(a(n)) = n.

%F (End)

%e a(12) = a(2^2*3) = prime(2)^2 * prime(3) = 3^2*5 = 45, where prime(n) = A000040(n).

%p a:= n-> mul(ithprime(i[1])^i[2], i=ifactors(n)[2]):

%p seq(a(n), n=1..70); # _Alois P. Heinz_, Sep 06 2018

%t Table[If[n == 1, 1, Apply[Times, FactorInteger[n] /. {p_, e_} /; p > 1 :> Prime[p]^e]], {n, 58}] (* _Michael De Vlieger_, Aug 22 2017 *)

%o (PARI) { for (n=1, 1000, f=factor(n)~; a=1; for (i=1, length(f), a*=prime(f[1, i])^f[2, i]); write("b064988.txt", n, " ", a) ) } \\ _Harry J. Smith_, Oct 02 2009

%o (PARI) a(n) = {my(f = factor(n)); for (k=1, #f~, f[k, 1] = prime(f[k, 1]);); factorback(f);} \\ _Michel Marcus_, Aug 08 2017

%o (Scheme) (define (A064988 n) (if (= 1 n) n (* (A000040 (A020639 n)) (A064988 (A032742 n))))) ;; _Antti Karttunen_, Aug 08 2017

%o (Python)

%o from sympy import factorint, prime

%o from operator import mul

%o def a(n): return 1 if n==1 else reduce(mul, [prime(p)**e for p, e in factorint(n).items()])

%o print([a(n) for n in range(1, 101)]) # _Indranil Ghosh_, Aug 08 2017

%Y Cf. A000040, A003961, A003963 (a left inverse), A006450, A048767, A257538, A290641.

%Y Cf. A076610 (terms sorted into ascending order).

%K mult,nonn

%O 1,2

%A _Vladeta Jovovic_, Oct 30 2001