[Question]
  [
Given a positive integer \$n\$ you can always find a tuple \$(k\_1,k\_2,...,k\_m)\$ of integers \$k\_i \geqslant 2\$ such that \$k\_1 \cdot k\_2 \cdot ... \cdot k\_m = n\$ and $$k\_1 | k\_2 \text{ , } k\_2 | k\_3 \text{ , } \ldots \text{ , }k\_{m-1}|k\_m.$$
Here \$a|b\$ means \$b\$ is a multiple of \$a\$, say "a divides b". If \$n>1\$ all entries \$k\_i\$ must be at least \$2\$. For \$n=1\$ we have no such factor and therefore we get an empty tuple.
In case you're curious where this comes from: This decomposition is known as *invariant factor decomposition* in number theory and it is used in the [classification of finitely generated
Abelian groups.](https://en.wikipedia.org/wiki/Abelian_group#Classification)
### Challenge
Given \$n\$ output *all* such tuples \$(k\_1,k\_2,...,k\_m)\$ for the given \$n\$ exactly once, in whatever order you like. The standard [sequence](/questions/tagged/sequence "show questions tagged 'sequence'") output formats are allowed.
### Examples
```
  1: () (empty tuple)
  2: (2)
  3: (3)
  4: (2,2), (4)
  5: (5)
  6: (6)
  7: (7)
  8: (2,2,2), (2,4), (8)
  9: (3,3), (9)
 10: (10)
 11: (11)
 12: (2,6), (12)
108: (2,54), (3,3,12), (3,6,6), (3,36), (6,18), (108)
```
Related: <http://oeis.org/A000688>, [List all multiplicative partitions of n](https://codegolf.stackexchange.com/questions/104707/list-all-multiplicative-partitions-of-n)
  
[Answer]
## Haskell, ~~66~~ ~~62~~ 60 bytes
```
f n=[n|n>1]:[k:l:m|k<-[2..n],l:m<-f$div n k,mod(gcd n l)k<1]
```
[Try it online!](https://tio.run/##DcdBDsIgEAXQq/xFF23aTqQrQ6g38ASEGCKiZGDaqHHVuyO7917@w4@ca42Q1cohF@W0ZZ11OdjMdiESN7WZOXYh/SDgqWyhf95Dcx7YKFeLT4IVxe/XG/r9neQLigM6WEWkFodxbDydXf0D "Haskell – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 13 bytes
```
Òœ€.œP€`êʒüÖP
```
[Try it online!](https://tio.run/##yy9OTMpM/f//8KSjkx81rdE7OjkASCUcXnVq0uE9h6cF/P9vaGABAA "05AB1E – Try It Online")
```
Ò                      # prime factorization of the input
 œ€.œ                  # all partitions
     P                 # product of each sublist
      €`               # flatten
        ê              # sorted uniquified
         ʒ             # filter by:
          üÖ           #  pairwise divisible-by (yields list of 0s or 1s)
            P          #  product (will be 1 iff the list is all 1s)
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 17 bytes
```
ÆfŒ!Œb€ẎP€€QḍƝẠ$Ƈ
```
[Try it online!](https://tio.run/##y0rNyan8//9wW9rRSYpHJyU9alrzcFdfAJACosCHO3qPzX24a4HKsfb/h9uPTnq4c8b//4YGFgA "Jelly – Try It Online")
[Answer]
# [JavaScript (V8)](https://v8.dev/), ~~73~~ 70 bytes
Prints the tuples in descending order \$(k\_m,k\_{m-1},...,k\_1)\$.
```
f=(n,d=2,a=[])=>n>1?d>n||f(n,d+1,a,d%a[0]||f(n/d,d,[d,...a])):print(a)
```
[Try it online!](https://tio.run/##JY2/DoIwHIR3nuK3GGg8K8V/KGmdXH2BpkNDQ8ShEiQs4rPXCtN9@S6Xe9rRvuu@7YbNWIbQyMzDyQJWasOk8kpcnfLT1Pz9WsDCrazOzWy2Dg7agXNuDWOXrm/9kFkWKi1QYIc9DjjihBJniBxCQBQRSpPw5tXfbP3IPElFn4RoGad3kpTSmjyroowncy5lxC8LPw "JavaScript (V8) – Try It Online")
### Commented
```
f = (             // f is a recursive function taking:
  n,              //   n   = input
  d = 2,          //   d   = current divisor
  a = []          //   a[] = list of divisors
) =>              //
  n > 1 ?         // if n is greater than 1:
    d > n ||      //   unless d is greater than n,
    f(            //   do a recursive call with:
      n,          //     -> n unchanged
      d + 1,      //     -> d + 1
      a,          //     -> a[] unchanged
      d % a[0] || //     unless the previous divisor does not divide the current one,
      f(          //     do another recursive call with:
        n / d,    //       -> n / d
        d,        //       -> d unchanged
        [d, ...a] //       -> d preprended to a[]
      )           //     end of inner recursive call
    )             //   end of outer recursive call
  :               // else:
    print(a)      //   this is a valid list of divisors: print it
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~17~~ ~~15~~ 14 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
Ñ¦IиæʒPQ}êʒüÖP
```
Very slow for larger test cases.
-1 byte thanks to *@Grimy*.
[Try it online.](https://tio.run/##ASIA3f9vc2FiaWX//8ORwqZJ0LjDpsqSUFF9w6rKksO8w5ZQ//80)
**Explanation:**
```
Ñ               # Get all divisors of the (implicit) input-integer
 ¦              # Remove the first value (the 1)
  Iи            # Repeat this list (flattened) the input amount of times
                #  i.e. with input 4 we now have [2,4,2,4,2,4,2,4]
    æ           # Take the powerset of this list
     ʒ  }       # Filter it by:
      PQ        #  Where the product is equal to the (implicit) input
         ê      # Then sort and uniquify the filtered lists
          ʒ     # And filter it further by:
           ü    #  Loop over each overlapping pair of values
            Ö   #   And check if the first value is divisible by the second value
             P  #  Check if this is truthy for all pairs
              
                # (after which the result is output implicitly)
```
[Answer]
# JavaScript, 115 bytes
```
f=(n,a=[],i=1)=>{for(;i++<n;)n%i||(a=a.concat(f(n/i).filter(e=>!(e[0]%i)).map(e=>[i].concat(e))));return n>1?a:[a]}
```
I will write an explanation later
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~78~~ ~~76~~ ... ~~61~~ 51 bytes
```
Do[i∣##&&##~#0~i,{i,2,-#/-##2/. 1:>Print@{##2}}]&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b73yU/OvNRx2JlZTU1ZeU6ZYO6TJ3qTB0jHV1lfV1lZSN9PQVDK7uAosy8EodqIL@2Nlbtf5qDlmtyRn5dcHJiXl01l6EOl5EOl7EOl4kOl6kOl5kOl7kOl4UOl6UOl6EBEAPlDY1AbAuuWn39wNLM1JL/AA "Wolfram Language (Mathematica) – Try It Online")
Recursive search tree.
Prints the list of decompositions.
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~18~~ 15 bytes
```
fΛ¦ufo=¹ΠṖmΠtṖp
```
[Try it online!](https://tio.run/##yygtzv7/P@3c7EPLStPybQ/tPLfg4c5puecWlACpgv///1sAAA "Husk – Try It Online")
Similar to Grimmy's 05AB1E answer.
-3 bytes from Zgarb.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~22~~ 19 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
ÆâÃcÅà â f@¶XcXäv)×
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=xuLDY8XgIOIgZkC2WGNY5HYp1w&footer=8SBxUg&input=NA)
```
ÆâÃcÅà â f@¶XcXäv)×     :Implicit input of integer U
Æ                       :Map the range [0,U)
 â                      :  Divisors of U
  Ã                     :End map
   c                    :Flatten after
    Å                   :  Slicing the first element off each
     à                  :Combinations
       â                :Deduplicate
         f              :Filter by
          @             :Passing each X through the following function
           ¶            :  Test U for equality with
            Xc          :  Concatenate to X
              Xä        :    Consecutive pairs of X
                v       :    Reduced by testing divisibility
                 )      :  End concat
                  ×     :  Reduce by multiplication
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 14 bytes
```
ḊœċRẎḍƝẠ×P=¥ʋƇ
```
[Try it online!](https://tio.run/##ATYAyf9qZWxsef//4biKxZPEi1Lhuo7huI3GneG6oMOXUD3CpcqLxof/MTDDh@KCrMWS4bmY4oKsWf8 "Jelly – Try It Online")
## How it works
```
ḊœċRẎḍƝẠ×P=¥ʋƇ - Main link. Takes n on the left
Ḋ              - Dequeue; Yield [2, 3, ..., n]
   R           - Range, Yield [1, 2, ..., n]
 œċ            - For each integer, 1 ≤ i ≤ n, yield combinations with
                  replacement of length i from the dequeued range
    Ẏ          - Tighten into a single list of lists
            ʋƇ - Keep those for which the following is true:
        ×  ¥   -   Both of the following are true:
      Ɲ        -     Over overlapping pairs:
     ḍ         -       Is the left divisible by the right?
       Ạ       -     Is all true?
        ×      -   And:
         P     -     The product
          =    -     Equals n?
```
]