[Question]
  [
Given an integer ***p > 1***, find the smallest integer ***q > p*** such that the list of exponents in the prime factorization of ***q*** is the same of that of ***p***, no matter the order or the value of the prime factors.
## Examples
The prime factorization of ***p = 20*** is ***22 x 51***. The smallest integer greater than ***p*** with identical exponents in its prime factorization is ***q = 28 = 22 x 71***.
The prime factorization of ***p = 2500*** is ***22 x 54***. The smallest integer greater than ***p*** with identical exponents in its prime factorization is ***q = 2704 = 24 x 132***.
## Rules
* The input is guaranteed to be an integer greater than 1.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest answer in bytes wins.
## Test cases
```
Input | Output
------+-------
2     | 3
20    | 28
103   | 107
256   | 6561
768   | 1280
2500  | 2704
4494  | 4510
46552 | 46584
75600 | 105840
```
  
[Answer]
# [Husk](https://github.com/barbuz/Husk), 10 bytes
```
§ḟ¤≡ȯÖLgp→
```
[Try it online!](https://tio.run/##yygtzv6vkHtiffGjpsaiQ9v@H1r@cMf8Q0sedS48sf7wNJ/0gkdtk/7//2/EZWTAZWhgzGVkasZlbmYBpA0MuExMLE24TMxMTY24zE3NDAwA "Husk – Try It Online")
### Explantion
```
§ḟ       →     Find the first number starting from the input + 1 such that...
        p        The prime factorisation
       g         with equal elements grouped together
    ȯÖL          and sorted by length of groups
  ¤≡             has the same shape as the above applied to the input.
```
[Answer]
# Mathematica, 61 bytes
```
(f[x_]:=Sort[Last/@FactorInteger@x];s=#;While[f@++s!=f@#];s)&  
```
[Try it online!](https://tio.run/##y00sychMLv6fbvtfIy26Ij7WyjY4v6gk2iexuETfwS0xuSS/yDOvJDU9tcihIta62FbZOjwjMyc1Os1BW7tY0TbNQRkoqqn2P6AoM69EwSE92sjUwCD2PwA "Mathics – Try It Online")
*-4 bytes from @Misha Lavrov*
[Answer]
# [Pyth](https://pyth.readthedocs.io), 15 bytes
```
fqFmShMrPd8,QTh
```
**[Try it here!](https://pyth.herokuapp.com/?code=fqFmShMrPd8%2CQTh&input=20&test_suite_input=2%0A20%0A103%0A256%0A768%0A2500%0A4494%0A46552%0A75600&debug=0)** or **[Verify all the test cases.](https://pyth.herokuapp.com/?code=fqFmShMrPd8%2CQTh&input=20&test_suite=1&test_suite_input=2%0A20%0A103%0A256%0A768%0A2500%0A4494%0A46552%0A75600&debug=0)**
## How does this work?
```
fqFmShMrPd8,QTh   ~ Full program. Q = first input.
f             h   ~ First input where the condition is truthy over [Q+1, Q+2, ...]
           ,QT    ~ The two element list [Q, current value (T)].
   m              ~ Map over ^ with d.
       Pd         ~ The prime factorization of d.
      r  8        ~ Run-Length encode ^.
    hM            ~ Get the first element of each.
 qF               ~ Check if the values are equal.
                  ~ Output implicitly.
```
---
## Alternatives
Another 15-byter:
```
LShMrPb8fqyQyTh
```
And a couple of (longer) alternatives:
```
fqFmSlM.gkPd,QTh
LSlM.gkPbfqyQyTh
LS/LPb{PbfqyQyTh
f!-FmlM.gkPd,QTh
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~15~~ 14 bytes
1 byte thanks to Erik the Outgolfer.
```
ÆEḟ0Ṣ
,Ç€Eð2#Ṫ
```
[Try it online!](https://tio.run/##AScA2P9qZWxsef//w4ZF4bifMOG5ogosw4figqxFw7AyI@G5qv///zI1MDA "Jelly – Try It Online")
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 13 bytes
```
<.;?{ḋḅlᵐ}ᵐ=∧
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r/30bP2r764Y7uhztacx5unVALxLaPOpb//29kavY/CgA "Brachylog – Try It Online")
It's been a long time since I posted an answer…
### Explanation
```
<.               Input < Output
 .;?             The list [Output, Input]
    {    }ᵐ      Map on [Output, Input]:
     ḋ             Prime decomposition
      ḅ            Group into sublists of consecutive equal elements
       lᵐ          Take the length of each sublist
           =∧    The result of the map must be the same for the Output and the Input
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~176~~ ~~179~~ ~~171~~ ~~170~~ 169 bytes
* Added three bytes as the question changed from *set of exponents* to *list of exponents*; `set(f)` was changed to `sorted(f)`.
* Saved eight bytes thanks to [ovs](https://codegolf.stackexchange.com/users/64121/ovs); golfing the if / else block down to multiplication.
* Saved a byte; golfed `(n!=r)` to `(n>r)`.
* Saved a byte; golfed `while N>1` to `while~-N`.
```
N=input();n=-~N
def F(N):
 r,f=0,[]
 while~-N:
	for n in range(2,-~N):
	 if N%n<1:f+=[1]*(n>r);f[-1]+=n==r;r=n;N/=n;break
 return sorted(f)
while F(N)!=F(n):n+=1
print n
```
[Try it online!](https://tio.run/##JU5BTsMwEDx3X7GNhGSTRDgmScFhuVTq0R@IcijUbiPQJjKugEu/Hkx7Gc2MZndm/o2nifWypSzLFksjz@coZMdUXiwcnMedsNIAhsKTKvoB8Ps0frpLaQ2s/BSQcWQMez46oYt0lMIrHD3aO36pjM@pr4Z7wa9Bdr4vqyEnJgpdIO7sQ4K34PYf6b@L58D4NYXoDsJLuNZc29e0EywN51TBHEaOyEta27kf957d1ijzL3CbLVqBblQCSKxSj0m1sGmfbm5dP9dQt02jYdO0Sv0B "Python 2 – Try It Online")
[Answer]
# [Haskell](https://www.haskell.org/), 107 bytes
```
import Data.List
import Data.Numbers.Primes
p=sort.map(1<$).group.primeFactors
f x=until((==p x).p)(+1)$x+1
```
[Try it online!](https://tio.run/##TcsxDgIhEEDRnlNMQQHZZBI6C@mMlTF7hdGwSoRlAkPC7XHtbP/Lf1P7hJTmjJlLFbiQEN5iE/Uf7j0/Qm241phDU@zbQZiJjTtri69aOiP/8EpPKbWpDYbvu8RkjPcMwyJbszirx@JmpriDh2PYBTRscJpf "Haskell – Try It Online") Usage example: `f 2500` yields `2704`.
Thanks to nimi for pointing out a flaw and saving a bunch of bytes.
---
### Without `primeFactors` build-in (117 bytes)
```
import Data.List
1%n=[]
x%n|0<-mod x n=n:div x n%n|m<-n+1=x%m
p=sort.map(1<$).group.(%2)
f x=until((==p x).p)(+1)$x+1
```
[Try it online!](https://tio.run/##FcuxCsIwEIDhPU9xQwIJocE4ifQ2R99AHAK1GkyuR5NKBt891u3ng/8VyvuRUu8x87JWuIQa3DWWKrwivN1FU/Q9jENeJmhASOcpfv61cx4Hsh6byoKx7LfLgbUfpXHPddnYaXU0YoaGG9WYtEZkaMax0dYb2azvOUQCBF4jVZAww6n/AA "Haskell – Try It Online")
[Answer]
# Python - 141 bytes
```
def s(n):
 i=1;d={}
 while n-1:
  i+=1
  if n%i<1:d[i]=d.get(i,0)+1;n/=i;i=1
 return d.values()
a=input()
j=a+1
while s(a)!=s(j):j+=1
print j
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 15 bytes
```
XµN‚εÓ0K{}ËNI›&
```
[Try it online!](https://tio.run/##ASUA2v8wNWFiMWX//1jCtU7igJrOtcOTMEt7fcOLTknigLom//8yNTAw "05AB1E – Try It Online")
**Explanation**
```
Xµ                # Loop over N in [0 ...] until 1 match is found
  N‚              # pair N with input
    ε    }        # apply to each
     Ó            # list prime exponents
      0K          # remove zeroes
        {         # sort
          Ë       # check that they are equal
              &   # and
           NI›    # that N is greater than the input
```
[Answer]
# [Python 3](https://docs.python.org/3/) + [Sympy](http://docs.sympy.org/latest/index.html), 118 bytes
```
from sympy.ntheory import*
f=lambda k:sorted(factorint(k).values())
g=lambda i,k=2:i<k and f(k)==f(i)and k or g(i,k+1)
```
[Try it online!](https://tio.run/##NczLDsIgEIXhfZ9iljNqGq27Rh4G5VJCYQhQE54e0cTl@fPlpFY3jvfeTeYApYXU5lg3zbmBC4lzPU1G7DI8lQS/lhG0QiNflbOLFT3Nb7kfuiDRZP/QXbxYVvfwIKMCM5QQBh19lwfOYHGQ8416@r1YXK5E/QM "Python 3 – Try It Online")
[Answer]
# [J](http://jsoftware.com/), 32 bytes
```
>:@]^:(1--:&(_&q:/:[[email protected]](/cdn-cgi/l/email-protection):))^:_>:
```
[Try it online!](https://tio.run/##JY5BC4JAEIXv/oqHhO5C2uy2u9qEoQRB0CHqmklEEl0i6hb0122iw/cxvDcwcxviPO1RMVKMQWAhy7HcbVbDguv2yMpkGSeqSx484U@d5cRaH7lb8KCj1/n0vDxR5egs2gMsprAEW8LQVChgfUDwwaAIEtpSSk@ighycm4m8Ibjgvf25dCh8kAVDMlN0OV/vUGgxh1JVrz8TjbeccRghXTXrzbbZ79O4g44N/t9Ewxc "J – Try It Online")
Start from input + 1 `>:` and keep incrementing while the list of prime factors `_&q:` minus any zeros `-.0:`, then sorted `/:~@`, does not match `1--:`.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 69 bytes
```
g=->m{m.prime_division.map{_2}.sort}
->n{((n+1)..).find{g[_1]==g[n]}}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=LU5LDoIwEN1zikY3EEPTQn8uyk4uQQjRIKQLCilgYggX0Q2JuvJE3kbSspr3mzfzfJvxcv9mu9B0RjXXXf5Kpf8ZhyoUv1Mtw6SZGmitolQ31atWw-bcTUU0w741w-yFiZ58Xx9wAGEAK6XLqc4KnEtZZzqf563sEXgdSLMoB2APYoeRJZGwDKPYUoy4cymznFGGrcCZcIFIoC2BtgaOiFUIORKrEIpdhjBK3c0VCZfilG2LGK0ach8ui5t_)
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 20 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
Hideous! But I can't think of a better way :\
```
@[UX]Ëk ü mÊñÃre}aUÄ
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=QFtVWF3LayD8IG3K8cNyZX1hVcQ&input=MjUwMA)
]