[Question]
  [
[Powerful numbers](https://en.wikipedia.org/wiki/Powerful_number) are positive integers such that, when expressed as a prime factorisation:
$$a = p\_1^{e\_1} \times p\_2^{e\_2} \times p\_3^{e\_3} \cdots \times p\_k^{e\_k}$$
all exponents \$e\_1, e\_2, ...\$ are greater than or equal to \$2\$. Note that the exponents do not include zero exponents, as exampled by \$200 = 2^3 \times 3^0\times 5^2 = 2^3 \times 5^2\$ being a powerful number. This includes all perfect powers, and a few "extra" numbers that are not perfect powers.
[Achilles numbers](https://en.wikipedia.org/wiki/Achilles_number) are powerful numbers that are not perfect powers. The smallest Achilles number is \$72 = 2^3 \times 3^2\$. The Achilles numbers less than or equal to \$500\$ are \$72, 108, 200, 288, 392, 432\$ and \$500\$.
You are to take an Achilles number as input and output the smallest Achilles number greater than the input.
You may input and output in any [convenient method](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods). This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so the shortest code in bytes wins
## Test Cases
```
input output
   72    108
  108    200
  200    288
  800    864
 1152   1323
 4500   4563
 3456   3528
 4563   4608
43808  43904
90828  91592
28800  29403
64800  64827
29768  30375
```
[The program I used to generate these test cases](https://tio.run/##ASMA3P9qZWxsef//4oCYw4ZFO2cvJMSLMcSwxpHGsjEj////NTAwMA). Contains spoilers for anyone who can understand Jelly.
  
[Answer]
# [J](http://jsoftware.com/), 26 bytes
```
_(]+1-1</@(=],+./)q:)^:_>:
```
[Try it online!](https://tio.run/##dY9NS8NAEIbv8ytePLQJadL9SjJZTCgKnqSHXqXtQVrESxH8/3F2x3qourALwzwz@7zv812D5RljxHIFgyi3bvC4e36aj8W@srW9X2@Kcb@qmnX5EctDPE5xBrYPDUDFDXBcKLKZIl0ZWx1i8Sd1C9n6JSbMLsaVHf8hp/hNFgn@jaavS6LT69sF1jCcMXDM4C7AeucR2s6jjjgvJvTuh2G51rZO@sbouG8dI3QCBD@YgMG2g7uOetmju4JnQQbDjnXODcF4dIFdD298315nxEN@kUZyGvqOibaXzxOspEsuckSH8psK8aL85oJTh7WQNKS6yKkoa0uRjEjlkAOQSiIHIXXVPJSVobFI3dSdVFEjUDaFJqFy/gI "J – Try It Online")
I started with the "do-until" idiom `f^:g^:_` with `g` boolean (apply `f` while `g` is true), but soon realized that the "find next integer" can be written in a single fixpoint `(]+1-g)^:_`. The only problem is that we don't have a straightforward/more golfy way to express the boolean negation of `g` other than `1-g`.
### How it works
```
_(]+1-1</@(=],+./)q:)^:_>:  NB. Input: n
                        >:  NB. n+1
_(                  )^:_    NB. Fixpoint with left arg of _ (infinity)...
                  q:    NB. (_ q: n) gives prime exponents including zeros
                        NB. _ q: 700 -> 2 0 2 1 (2^2 * 5^2 * 7^1)
          ( ],+./)      NB. Append GCD of ^ to itself
      1    =            NB. Test if each number equals 1 (gives boolean vector)
       </@   NB. Test if the only 1 is the last item
  ]+1-       NB. Negate the condition and add to the input number
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 12 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
‘ÆEg/ḟ$f1Ʋ1#
```
A full program which prints the next Achilles number.
**[Try it online!](https://tio.run/##y0rNyan8//9Rw4zDba7p@g93zFdJMzy2yVD5////pgYGBgA "Jelly – Try It Online")** Or see the [test-suite](https://tio.run/##y0rNyan8//9Rw4zDba7p@g93zFdJMzy2yVD5/9E9h9sfNa1xU3H//9/cSMfQwELHyMBAxwKIDQ1NjXRMTIEsYxNTMyDLzFjHxNgCqMLSwMIIqM4CpMrMBEQaWZqbWQAA "Jelly – Try It Online").
### How?
```
‘ÆEg/ḟ$f1Ʋ1# - Main Link: Archiles number (or any integer), n
‘            - increment (n)
          1# - find the first k (starting at k=n+1) for which:
         Ʋ   -   last four links as a monad - i.e. f(k):
 ÆE          -     prime exponent vactor (e.g k=400 -> [3,0,2] since 2^3+3^0+5^2)
      $      -     last two links as a monad:
    /        -       reduce by:
   g         -         Greatest Common Divisor -> x
     ḟ       -      filter discard (from [x] if in ÆE result)
        1    -     one
       f     -     filter keep (i.e. [1] if g/ was 1 and 1 not in ÆE result)
                   (empty list is falsey, so we keep incrementing k until we get [1])
```
[Answer]
# JavaScript (ES6), ~~117 ... 99~~ 98 bytes
```
f=n=>(d=1,h=(n,x)=>++d>n?~x:1/(g=_=>q=n%d?0:g(n/=d)-1)(G=x=>q?G(q,q=x%q):x)|h(n,G(x)))(++n)?f(n):n
```
[Try it online!](https://tio.run/##Zc3BCoJAEMbxe0@xl2AGLXddtUUYPfoYEW1qEWNWxB6iV7c9ZMF2/f/4Zk67x@62vx4v9xUP9jBNLTFVYEnFPQHHDqmKIltx/XKlSqCjLVUj8dLWsuyAE7K4UggNOd/rBsZ4JLccsXT47P2BBhwiQhQx1i0wljztB74N58P6PHTQghCbFFEkiRBCSbMI1KdZUylD9emr5m9rfmqKLFCl8vmv0qkONMu/2ywvQtW@fVTnqfnbFnreFtJMbw "JavaScript (Node.js) – Try It Online")
### Commented
```
f = n => (              // f is a recursive function taking n
  G = x =>              // G is a helper function computing GCD(x, q)
    q ? G(q, q = x % q) // (NB: actually defined in a dummy argument
      : x,              // passed to g in the last golfed version)
  d = 1,                // initialize the divisor d
  h = (                 // h is a recursive function taking:
    n,                  //   n = updated value
    x                   //   x = GCD of the exponents (but negative)
  ) =>                  //
    ++d > n ?           // increment d; if it's greater than n:
      ~x                //   stop and yield -x - 1
    :                   // else:
      1 / (g = _ =>     //   g is yet another recursive function
        q =             //   which computes q:
          n % d ?       //   the opposite of the number of times n can be
            0           //   divided by d
          :             //
            g(n /= d)   //   we compute 1 / g() followed by a bitwise OR
            - 1         //   to make sure that q is not equal to -1
      )() |             //
      h(                //   recursive call to h:
        n,              //     updated value of n
        G(x)            //     x = GCD(x, q)
      )                 //   end of recursive call
)(++n) ? f(n)           // if the result of h is truthy, try again
       : n              // otherwise, return n
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~14~~ 13 bytes
```
‘‘ÆE’Pȧg/Ʋ’Ɗ¿
```
[Try it online!](https://tio.run/##y0rNyan8//9RwwwgOtzm@qhhZsCJ5en6xzYBWce6Du3/f7j9UdOayP//zY10DA0sdIwMDHQsgNjQ0NRIx8QUyDI2MTUDssyMdUyMLYAqLA0sjIDqLECqzExApJGluZkFAA "Jelly – Try It Online")
Did not look at the linked Jelly answer, but that byte count does look familiar... until I remembered how I was originally checking the GCD anyhow
edit: they're not even remotely alike what the hell
```
‘                Starting at 1 more than the input,
 ‘         Ɗ¿    increment while:
  ÆE     Ʋ       for the exponents of the prime factorization,
     P           the product of
    ’            each minus 1
      ȧ          logical-AND
       g/        their greatest common denominator
          ’      is not equal to 1.
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), ~~20~~ 18 bytes
```
f&!}1J/LPTPTqiFJ1h
```
[Try it online!](https://tio.run/##K6gsyfj/P01NsdbQS98nICQgpDDTzcsQKGZiamAAAA "Pyth – Try It Online")
*-2 bytes thanks to [FryAmTheEggman](https://codegolf.stackexchange.com/users/31625/fryamtheeggman)!*
---
Explanation:
```
f                hQ | first integer T starting at input + 1 such that
      /LPTPT        | each prime factor's count in the prime factor list of T
     J              | (this list will be called J)
  !}1               | does not contain 1
 &                  | AND
             iFJ    | the GCD of all of the elements of J
            q   1   | equals 1
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~17~~ ~~19~~ ~~18~~ 14 bytes
~~Fixed thanks to Giuseppe but had to add 2 bytes~~. As Neil and caird coinheringaahing pointed out, not only was my second condition unnecessary, my third condition was just plain wrong. Hopefully it's fixed now.
```
ḟö§¤>ε▼F⌋mLgp→
```
[Try it online!](https://tio.run/##ASYA2f9odXNr///huJ/DtsKnwqQ@zrXilrxG4oyLbUxncOKGkv///zIwMA "Husk – Try It Online")
```
ḟö§¤>ε▼F⌋mLgp→
             → Increment input
ḟ              Find the smallest number greater than or equal to n+1 matching this condition:
            p    Prime factorization
           g     Group equal adjacent elements
         m       Map each to
          L       its length (the powers)
  §             Fork (apply two functions to the powers and then combine the results)
      ▼          First function: Minimum power
       F         Second function: Reduce with
        ⌋         gcd
   ¤>ε           Function to combine with:
   ¤              Apply one function to both arguments, then combine with another function
     ε             Check if equal to 1 (1 if 1, 0 otherwise)
    >              Ensure the minimum is not 1, but the gcd is.
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 12 bytes
A port of [Bubbler's J answer](https://codegolf.stackexchange.com/a/219550/64121).
```
∞+.ΔÓD¿ªΘ.«‹
```
[Try it online!](https://tio.run/##yy9OTMpM/X9u6/9HHfO09c5NOTzZ5dD@Q6vOzdA7tPpRw87//6PNjXQUDA0sdBSMDAx0FCxAhKGhKVDQxBTENjYxNQOxzYyBpLEFSKGlgYURSL0FWLGZCZgysjQ3s4gFAA "05AB1E – Try It Online")
```
∞            # push an infinite list of numbers [1,2,3,...]
 +           # add the input to each number
  .Δ         # find the first integer in this list that satisfies:
    Ó        # the exponents of the prime factorization (including 0's)
     D       # duplicate this list
      ¿      # take the gcd
       ª     # and append it to the exponents
        Θ    # for each value: is it equal to 1?
         .«  # right reduce this list of 0's and 1's
           ‹ # with a < b, this is only 1 if the list had a single 1 at the end
```
The same length without the `.Δ` builtin:
```
[>DÓD¿ªΘ.«‹#
```
[Try it online!](https://tio.run/##yy9OTMpM/X9u6/9oO5fDk10O7T@06twMvUOrHzXsVP7/P9rcSEfB0MBCR8HIwEBHwQJEGBqaAgVNTEFsYxNTMxDbzBhIGluAFFoaWBiB1FuAFZuZgCkjS3Mzi1gA "05AB1E – Try It Online")
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), ~~157~~ 115 bytes
```
.+
$*11
+`^(1+)((\1(1+))(?=(\3*)\1*$)\3*(?=\4$\5))+1$|^(?!((?=(11+?)\7*$)((?=\7+$)(?=(1+)(\9+)$)\10){2,})+1$)
1$&
1
```
[Try it online!](https://tio.run/##HYyxCsJAEET7@4vAEnZug2SicljI/cgSTGFhYyF2mm8/b61mBt6b1/39eG6tHSxJJpPdVqVB1RkJrVf1Y4YzC3rp20/iZ8Ao31XroIGQVuGlMzG9mPzNePKLoauc8VmmPTQkypjYWll@ "Retina 0.8.2 – Try It Online") No test suite because it would be too slow. Explanation:
```
.+
$*11
```
Convert to unary and add 1.
```
+`
```
Repeat while...
```
^(1+)((\1(1+))(?=(\3*)\1*$)\3*(?=\4$\5))+1$|
```
... the current value is a perfect power, or...
```
^(?!((?=(11+?)\7*$)((?=\7+$)(?=(1+)(\9+)$)\10){2,})+1$)
```
... the current value is not powerful...
```
1$&
```
... increment the value.
```
1
```
Convert to decimal.
I'm currently testing whether a number is powerful based on taken from my answer to [Is it almost-prime?](https://codegolf.stackexchange.com/questions/210162/) except here I divide at least twice by each (prime) factor and then repeat until all factors have been consumed. In theory it should be possible to take any factors and divide at least twice by each, but for some reason I don't seem to be able to adapt the expression for perfect powers to match a product of perfect powers.
[Answer]
# Java, ~~194~~ ~~167~~ ~~160~~ 152 bytes
*Saved 7 bytes thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904)*
*Saved 8 bytes thanks to [user](https://codegolf.stackexchange.com/users/95792)*
```
int a(int n){return p(++n)!=1?a(n):n;}int p(int n){for(int i=1,o=n,c,z;++i<o;){for(c=z=1;n%i<1;c++)n/=i;while(z<o)z*=i;if(c==2|z==o)return 0;}return n;}
```
[Try it online!](https://tio.run/##hY1NTsMwEIX3nGJYVLJxCDgSQqoz4gSsukQsjJsWl2Qc2U4rUnL24KQpW2YxP@99o3fQR31/2H6NbfdRWwOm1iHAq7YE5xtItegh6pjG0dktNMllm@gt7d/eQft94Bd2qvm1AQSqTvPBuPozN98hVk3uupi36T3WxJpcs@eC/w/J4ulKDWOSQbOpEz/7KnaeoGVCEL9F@aIZ8TWpYfLbK7Vzfl4tyswhZSbrlRC2dOriGexRKlrZUiojBKcHtOr0aeuK9aXj/V067S5hWPz0iI4vsY9qWLaUOA7jLw)
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), ~~17~~ 16 bytes
```
<.ḋḅ{{Ṁlf⊇}ᵛ!}Ȯ∧
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/pfXa6koGunoFRu/6htw6Ompoe7Omsfbp3w30bv4Y7uhztaq6sf7mzISXvU1Q4Unq1Ye2Ldo47l//9HmxvpGBpY6BgZGOhYALGhoamRjokpkGVsYmoGZJkZ65gYWwBVWBpYGAHVWYBUmZmASCNLczOLWAA "Brachylog – Try It Online")
Looked like it might compete with Jelly until I realized where I'd have to put that cut! Trying to see if maybe I could do not-a-perfect-power checking without going through the factors of the prime exponents.
```
 .                  The output
<                   is a number strictly greater than the input
   ḅ                of which the runs of
  ḋ                 the prime factors
     {    }ᵛ        each
      Ṁ             contain at least two elements,
        f           and the factors of
       l            the lengths of which
    {    ⊇ ᵛ!}      have a largest common subset
               ∧    (not necessarily equal to the output)
              Ȯ     which contains only one element.
```
[Answer]
# [Japt](https://ethproductions.github.io/japt/), 24 bytes
Definitely struggled to cut this short since some of the operations are bulky by themselves, for example getting the exponents.
```
_=k ü mÊ;Zry ¶1©Ze¨2}aUÄ
                      UÄ // Starting at input plus one,
                     a   // find the next integer that returns true when
_                   }    // run through the function:
 =                       // Z = 
  k                      // prime factors
    ü                    // grouped by value
      mÊ                 // and mapped to length, e.g. the exponents of prime factors.
        ;                // Return whether
         Zry ¶1          // GCD of Z equals 1
               ©         // and
                Ze¨2     // every member of Z is geq 2.
```
[Try it out here.](https://ethproductions.github.io/japt/?v=1.4.6&code=Xz1rIPwgbco7WnJ5ILYxqVplqDJ9YVXE&input=LVEKMjg4)
]