cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A046523 Smallest number with same prime signature as n.

This page as a plain text file.
%I A046523 #61 Feb 04 2022 14:26:35
%S A046523 1,2,2,4,2,6,2,8,4,6,2,12,2,6,6,16,2,12,2,12,6,6,2,24,4,6,8,12,2,30,2,
%T A046523 32,6,6,6,36,2,6,6,24,2,30,2,12,12,6,2,48,4,12,6,12,2,24,6,24,6,6,2,
%U A046523 60,2,6,12,64,6,30,2,12,6,30,2,72,2,6,12,12,6,30,2,48,16,6,2,60,6,6,6,24,2
%N A046523 Smallest number with same prime signature as n.
%H A046523 T. D. Noe, <a href="/A046523/b046523.txt">Table of n, a(n) for n = 1..10000</a>
%F A046523 In prime factorization of n, replace most common prime by 2, next most common by 3, etc.
%F A046523 a(n) = A124859(A124859(n)) = A181822(A124859(n)). - _Matthew Vandermast_, May 19 2012
%F A046523 a(n) = A181821(A181819(n)). - _Alois P. Heinz_, Feb 17 2020
%e A046523 If p,q,... are different primes, a(p)=2, a(p^2)=4, a(pq)=6, a(p^2*q)=12, etc.
%e A046523 n = 108 = 2*2*3*3*3 is replaced by a(n) = 2*2*2*3*3 = 72;
%e A046523 n = 105875 = 5*5*5*7*11*11 is represented by a(n) = 2*2*2*3*3*5 = 360.
%e A046523 Prime-powers are replaced by corresponding powers of 2, primes by 2.
%e A046523 Factorials, primorials and lcm[1..n] are in the sequence.
%e A046523 A000005(a(n)) = A000005(n) remains invariant; least and largest prime factors of a(n) are 2 or p[A001221(n)] resp.
%p A046523 a:= n-> (l-> mul(ithprime(i)^l[i][2], i=1..nops(l)))
%p A046523         (sort(ifactors(n)[2], (x, y)->x[2]>y[2])):
%p A046523 seq(a(n), n=1..100);  # _Alois P. Heinz_, Aug 18 2014
%t A046523 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]]
%t A046523 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 *)
%o A046523 (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
%o A046523 (PARI) A046523(n)=factorback(primes(#n=vecsort(factor(n)[,2],,4)),n) \\ _M. F. Hasler_, Oct 12 2018, improved Jul 18 2019
%o A046523 (Haskell)
%o A046523 import Data.List (sort)
%o A046523 a046523 = product .
%o A046523           zipWith (^) a000040_list . reverse . sort . a124010_row
%o A046523 -- _Reinhard Zumkeller_, Apr 27 2013
%o A046523 (Python)
%o A046523 from sympy import factorint
%o A046523 def P(n):
%o A046523     f = factorint(n)
%o A046523     return sorted([f[i] for i in f])
%o A046523 def a(n):
%o A046523     x=1
%o A046523     while True:
%o A046523         if P(n) == P(x): return x
%o A046523         else: x+=1 # _Indranil Ghosh_, May 05 2017
%o A046523 (Python)
%o A046523 from math import prod
%o A046523 from sympy import factorint, prime
%o A046523 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
%Y A046523 A025487 gives range of values of this sequence.
%Y A046523 Cf. A000142, A002110, A003418, A001221, A000040, A000005, A124010, A071364, A085079, A089247.
%Y A046523 Cf. A181819, A181821.
%K A046523 nonn,easy,nice
%O A046523 1,2
%A A046523 _N. J. A. Sloane_
%E A046523 Corrected and extended by _Ray Chandler_, Mar 11 2004