[Question]
  [
The title of Numberphile's newest video, [13532385396179](https://www.youtube.com/watch?v=3IMAUm2WY70), is a fixed point of the following function \$f\$ on the positive integers:
> 
> Let \$n\$ be a positive integer. Write the prime factorization in the usual way, e.g. \$60 = 2^2 \cdot 3 \cdot 5\$, in which the primes are written in increasing order, and exponents of 1 are omitted. Then bring exponents down to the line and omit all multiplication signs, obtaining a number \$f(n)\$. [...] for example, \$f(60) = f(2^2 \cdot 3 \cdot 5) = 2235\$.
> 
> 
> 
(The above definition is taken from Problem 5 of [Five $1,000 Problems - John H. Conway](https://oeis.org/A248380/a248380.pdf))
Note that \$f(13532385396179) = f(13 \cdot 53^2 \cdot 3853 \cdot 96179) = 13532385396179\$.
## Task
Take a positive composite integer \$n\$ as input, and output \$f(n)\$.
## Another example
\$48 = 2^4 \cdot 3\$, so \$f (48) = 243\$.
## Testcases
More testcases are available [here](https://pastebin.com/VKnL9eFF).
```
   4 -> 22
   6 -> 23
   8 -> 23
  48 -> 243
  52 -> 2213
  60 -> 2235
 999 -> 3337
9999 -> 3211101
```
  
[Answer]
# Python, ~~166~~ ~~162~~ 159 bytes
You guys are much better. This is what I used! (the algorithm that solved it calls this)
```
from primefac import*
def c(n):
 x=factorint(n)
 a=''
 for i in range(len(x)):
  l=min(x.keys())
  a+=str(l)
  if x[l]>1:a+=str(x[l])
  x.pop(l)
 return int(a)
```
[Answer]
## [Jelly](https://github.com/DennisMitchell/jelly), 6 bytes
```
ÆFFḟ1V
```
[Try it online!](https://tio.run/##y0rNyan8//9wm5vbwx3zDcP@//9vCQQA "Jelly – Try It Online")
### Explanation
```
ÆF      Get prime factorisation of input as prime-exponent pairs.
  F     Flatten.
   ḟ1   Remove 1s.
     V  Effectively flattens the list into a single integer.
```
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 8 bytes
```
ḋoọc;1xc
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r//@GO7vyHu3uTrQ0rkv//t7S0/B8FAA "Brachylog – Try It Online")
### Explanation
```
Example input: 60
ḋ          Prime decomposition: [5,3,2,2]
 o         Order: [2,2,3,5]
  ọ        Occurences: [[2,2],[3,1],[5,1]]
   c       Concatenate: [2,2,3,1,5,1]
    ;1x    Execute 1s: [2,2,3,5]
       c   Concatenate: 2235
```
You can use `ℕ₂ˢ` (*select all integers greater than or equal to 2*) instead of `;1x`, which is probably more readable and more in the spirit of Brachylog.
[Answer]
# [Mathics](http://mathics.github.io/), 34 bytes
```
Row[Join@@FactorInteger@#/.1->""]&
```
[Try it online!](https://tio.run/##y00sychMLv6fZvs/KL882is/M8/BwS0xuSS/yDOvJDU9tchBWV/PUNdOSSlW7X9AUWZeiYJDmoMlEPwHAA "Mathics – Try It Online")
-2 bytes from @sanchez
[Answer]
## [CJam](https://sourceforge.net/p/cjam), 8 bytes
```
limF:~1-
```
[Try it online!](https://tio.run/##S85KzP1f/T8nM9fNqs5Q939sXq2F1n8TLjMuCy4TCy5TIy4zAy5LS0sQtgQA "CJam – Try It Online")
### Explanation
```
li  e# Read input and convert to integer.
mF  e# Get prime factorisation as prime-exponent pairs.
:~  e# Flatten.
1-  e# Remove 1s.
    e# Implicitly print a flattened representation of the list.
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 10 bytes
```
Òγʒ¬?gDië?
```
[Try it online!](https://tio.run/##MzBNTDJM/f//8KRzm09NOrTGPt0l8/Bq@///LYEAAA "05AB1E – Try It Online")
```
Ò          # Push list of prime factors with duplicates
 γ         # Break into chunks of consecutive elements
  ʒ        # For each
   ¬?      #   Print the first element
     gD    #   Push the length of this chunk twice
       ië  #   If not 1
         ? #     Print the length
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~12~~ 11 bytes
```
Òγvy¬sgD≠×J
```
[Try it online!](https://tio.run/##MzBNTDJM/f//8KRzm8sqD60pTnd51Lng8HSv//9NLAA "05AB1E – Try It Online")
**Explanation**
```
Ò            # calculate prime factors with duplicates
 γ           # group consecutive equal elements
  vy         # for each group
    ¬        # get the head without popping
     sg      # push the length of the group
       D≠×   # repeat the length (length != 1) times
          J  # join
```
[Answer]
# Pyth, 12 bytes
```
smjk_>hddr8P
```
[Try it!](https://pyth.herokuapp.com/?code=smjk_%3Ehddr8P&input=9999&debug=0)
### alternative, 12 bytes
```
smjk<_AdGr8P
```
[Try that!](https://pyth.herokuapp.com/?code=smjk%3C_AdGr8P&input=9999&debug=0)
### explanation
```
smjk_>hddr8P
           PQ  # prime factorization (already in correct order) of the implicit input: [3, 3, 11, 101]
         r8    # length encode: [[2, 3], [1, 11], [1, 101]]
 m             # map over the length encoded list (lambda variable: d)
     >hdd      # take the d[0] last elements of d (so only the last for d[0]==1 and all else)
    _          # reverse that list
  jk           # join into a string
s              # conatenate the list of strings
```
[Answer]
# Pyth, 11 bytes
```
jksm_-d1r8P
```
[Try here](http://pyth.herokuapp.com/?code=jksm_-d1r8P&test_suite=1&test_suite_input=4%0A6%0A8%0A48%0A52%0A60%0A999%0A9999&debug=0)
[Answer]
# [Python 2](https://docs.python.org/2/), 99 bytes
```
n=input()
r=''
p=2
while~-n:
 e=0
 while n%p<1:e+=1;n/=p
 r+=str(p)*(e>0)+str(e)*(e>1);p+=1
print r
```
**[Try it online!](https://tio.run/##HcrBCoMwDIDhe54iF7G1iK236eLbBFoYWcgqsstevVP/2we/fmt@y9yaUBHdq/Ng1PegNMORy4t/oyyATBHwNkqnz7RwoLTKRApogT7VnPrB8RZ9uMA3kl/1/ECtSEVr7XH2Bw "Python 2 – Try It Online")**
If inputs are restricted to be below `2147483659`, both `str(...)` may be replaced by ``...`` saving 6 bytes (this program will be **very** slow for numbers affected anyway!).
[Answer]
# [Ohm](https://github.com/MiningPotatoes/Ohm), 11 bytes
```
o:_]D2<?O;J
```
[Try it online!](https://tio.run/##y8/I/f8/3yo@1sXIxt7f2uv/f0sgAAA "Ohm – Try It Online")
### Explanation
```
o:_]D2<?O;J
o           # Push prime factors with powers from input (Format [[prime,power],...]
 :          # For each...
  _          # Push current element
   ]         # flatten
    D        # Duplicate power
     2<? ;   # Is the power smaller than 2?
        O     # Delete top of stacks
          J  # Join
  
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 19 bytes
```
k ó¥ ®¯1 pZlÃc fÉ q
```
[Test it online!](http://ethproductions.github.io/japt/?v=1.4.5&code=ayDzpSCurzEgcFpsw2MgZskgcQ==&input=OTk5OQ==)
### Explanation
```
 k ó¥  ®   ¯  1 pZlÃ c fÉ  q
Uk ó== mZ{Zs0,1 pZl} c f-1 q  // Ungolfed
                              // Implicit: U = input number
Uk                            // Break U into its prime factors.
   ó==                        // Group into runs of equal items.
       mZ{         }          // Map each item Z in this to
          Zs0,1               //   Z.slice(0, 1) (the array of the first item),
                pZl           //   with Z.length added at the end.
                              // This returns an array of prime-exponent pairs (Jelly's ÆF).
                     c        // Flatten.
                       f-1    // Filter to the items X where X - 1 is truthy (removes '1's).
                           q  // Join the resulting array into a single string.
                              // Implicit: output result of last expression
```
[Answer]
# [PHP](https://php.net/), 88 bytes
```
for($i=2;1<$a=&$argn;)$a%$i?$i++:$a/=$i+!++$r[$i];foreach($r as$k=>$v)echo$k,$v<2?"":$v;
```
[Try it online!](https://tio.run/##HYtBCoMwFAX3nkLDU5QUpO7055uDSBcfsSYINaSQ66ehsxoYJriQjQ0uVJB4fljNBUX5fccenid6Ggh3/0gDpIW38FovkJGLNFojbvAvKschu@sRa/ni4hVpOHZ343ogmckqtSBRzj8 "PHP – Try It Online")
[Answer]
# [R](https://www.r-project.org/), 72 bytes
```
x=rle(pracma::factors(scan()));x$l[x$l<2]='';paste0(x$v,x$l,collapse='')
```
Requires the `pracma` package, which is not installed on TIO.
[Answer]
# [APL (Dyalog Extended)](https://github.com/abrudz/dyalog-apl-extended), ~~15~~ 14 bytes
Saved 1 byte thanks to @Adám
```
∊⍕¨1~⍨∊⍉2⌂pco⎕
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn/qKM9DUh0PeqdemiFYd2j3hVgTqfRo56mguT8R31TQUr@p3GZcKVxmQGxBRCbgAhTI5CIAZCwtLSEkJYA "APL (Dyalog Extended) – Try It Online")
```
∊⍕¨1~⍨∊⍉2⌂pco⎕
               ⎕      ⍝ Input
          2⌂pco        ⍝ Prime factors with exponents
        ⍉             ⍝ Transpose so the 1st column is factors, 2nd is exponents
       ∊               ⍝ Flatten
    1~⍨               ⍝ Remove 1
 ⍕¨                   ⍝ Convert each to a string
∊                      ⍝ Concatenate them together
```
[Answer]
# C#, ~~206~~ 100 bytes
```
n=>{var r="";for(int d=1,c;++d<=n;){c=0;while(n%d<1){c++;n/=d;}r+=c>0?d+(c>1?c+"":""):"";}return r;}
```
Full/Formatted version:
```
using System;
class P
{
    static void Main()
    {
        Func<int, string> func = n =>
        {
            var r = "";
            for (int d = 1, c; ++d <= n;)
            {
                c = 0;
                while (n % d < 1)
                {
                    c++;
                    n /= d;
                }
                r += c > 0 ? d + (c > 1 ? c + "" : "") : "";
            }
            return r;
        };
        Console.WriteLine(func(4));
        Console.WriteLine(func(6));
        Console.WriteLine(func(8));
        Console.WriteLine(func(48));
        Console.WriteLine(func(52));
        Console.WriteLine(func(60));
        Console.WriteLine(func(999));
        Console.WriteLine(func(9999));
        Console.ReadLine();
    }
}
```
[Answer]
# Javascript - 91 bytes
```
(x,r='',i=1,n)=>{while(x>i++){for(n=0;x%i<1;n++)x/=i;r+=(n>0?i+'':'')+(n>1?n:'')}return r}
```
## Explanation
```
(x,r='',i=1,n)=>(          // input x is the number to process, r, i, n are default values only
    while(x>i++){          // iterate over i until x
        for(n=0;x%i<1;n++) // iterate over n until i is not a factor of x
            x/=i;          // factor i out of x
        r+=(n>0?i+'':'')   // append i to r if n > 0
            +(n>1?n:'')    // append n to r if n > 1
                           // i+'' prevents adding i and n before appending to r
    }
    return r               // return r by comma-operator and arrow function syntax
)
```
[Answer]
# Java 8, 103 chars
Pretty straightforward solution.
```
n->{String r="";int d=2,c;while(n>1){c=0;while(n%d<1){c++;n/=d;}if(c>0)r+=d;if(c>1)r+=c;d++;}return r;}
```
Ungolfed:
```
private static Function<Integer, String> f = n->{
    String result = "";
    int divisor = 2, count;
    while (n>1) {
        count = 0;
        while (n % divisor < 1) {
            count++;
            n /= divisor;
        }
        if (count > 0) result += divisor;
        if (count > 1) result += count;
        divisor++;
    }
    return result;
};
```
[Answer]
# [Octave](https://www.gnu.org/software/octave/), 69 bytes
```
@(a)printf('%d',(f=[[~,c]=hist(b=factor(a),d=unique(b));d](:))(f~=1))
```
[Try it online!](https://tio.run/##Dco5DoAgEADA1xh2EwptLDSb@A9CsVyRBpTD0q@jU0@2jR8/xgGMV4mpBRCTExICKfVKq@mMtYGhwLbl8i/pqKd4dw8GcXcaNkQILy2Ig1OFdcbxAQ "Octave – Try It Online")
Ended up being quite long, but this will generate the desired output.
Essentially we use the histogram function to count the number of occurrences of the unique values in the prime factorisation of the input value.
* The result of the `factor()` function gives the prime factors in ascending order
* we then find `unique()` values in that array
* `hist()` returns the number of occurrences
Once we have the two arrays (one for unique factors, one for counts), we concatenate the arrays vertically (one on top of the other), and then flatten. This interleaves the factors with counts.
Finally we display the result as a string ensuring to skip any 1's in the final array. The only time 1's can appear is if the count was 1 because 1 will never be a prime factor. This elimination is done before converting to a string so it won't affect things like the number 10.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 45 + 7 bytes
Requires the flag `-rprime`.
```
->n{(n.prime_division.flatten-[1]).join.to_i}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y6vWiNPr6AoMzc1PiWzLLM4Mz9PLy0nsaQkNU832jBWUy8rPzNPryQ/PrP2f4FCWrQlEMQq2NoqGBsZGhoaGHJBBSFixsbm////yy8oARpT/F@3CGwwAA "Ruby – Try It Online")
[Answer]
# Pyth - 16 bytes
```
V{PQpNK/PQNItKpK
```
[Try it](https://pyth.herokuapp.com/?code=V%7BPQpNK%2FPQNItKpK&input=18&debug=0)
Another solution:
```
sm`d-.nm(d/PQd){PQ1
```
]