[Question]
  [
The [Home Prime](https://en.wikipedia.org/wiki/Home_prime) of an integer \$n\$ is the value obtained by repeatedly factoring and concatenating \$n\$'s prime factors (in ascending order, including repeats) until reaching a fixed point (a prime). For example, the Home Prime (\$\text{HP}(n)\$) of \$10\$ is \$773\$ as:
$$\begin{align}
10 & = 2 \times 5 \to 25 \\
25 & = 5 \times 5 \to 55 \\
55 & = 5 \times 11 \to 511 \\
511 & = 7 \times 73 \to 773 \\
\end{align}$$
There are two equivalent ways to consider when the sequence ends:
* It ends at a prime
* It reaches a fixed point, as the prime factors of a prime \$p\$ is just \$p\$
Note that the Home Prime of some numbers is currently unknown (e.g. \$49\$ or \$77\$).
---
You are to take a positive integer \$n \ge 2\$ as input through any [convenient method or format](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods) and output the Home Prime of \$n\$. You may assume that you don't have to handle any input that would exceed the integer limit in your language at any step, and you may assume that the input will already have a known Home Prime (so 49 won't be an input).
Make sure you program handles all inputs correctly, not just those that are only semiprimes:
$$\begin{align}
\text{HP}(24) = 331319 :\\
24 & = 2 \times 2 \times 2 \times 3 \to 2223 \\
2223 & = 3 \times 3 \times 13 \times 19 \to 331319
\end{align}$$
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so the shortest code in bytes wins!
## Test cases
These are the results for each \$2 \le n \le 100\$, excluding \$n = 49,77,80,96\$ which don't terminate on TIO in my example program.
```
  2                                  2
  3                                  3
  4                                211
  5                                  5
  6                                 23
  7                                  7
  8                3331113965338635107
  9                                311
 10                                773
 11                                 11
 12                                223
 13                                 13
 14                              13367
 15                               1129
 16                           31636373
 17                                 17
 18                                233
 19                                 19
 20                3318308475676071413
 21                                 37
 22                                211
 23                                 23
 24                             331319
 25                                773
 26                               3251
 27                              13367
 28                                227
 29                                 29
 30                                547
 31                                 31
 32                             241271
 33                                311
 34                              31397
 35                               1129
 36                              71129
 37                                 37
 38                                373
 39                                313
 40                      3314192745739
 41                                 41
 42                                379
 43                                 43
 44                        22815088913
 45                            3411949
 46                                223
 47                                 47
 48             6161791591356884791277
 50                               3517
 51                                317
 52                               2213
 53                                 53
 54                               2333
 55                                773
 56                              37463
 57                               1129
 58                                229
 59                                 59
 60                              35149
 61                                 61
 62                              31237
 63                                337
 64                      1272505013723
 65 1381321118321175157763339900357651
 66                               2311
 67                                 67
 68                               3739
 69                              33191
 70                                257
 71                                 71
 72                            1119179
 73                                 73
 74                                379
 75                                571
 76                             333271
 78                         3129706267
 79                                 79
 81                    193089459713411
 82                                241
 83                                 83
 84                               2237
 85                               3137
 86          6012903280474189529884459
 87         41431881512748629379008933
 88                             719167
 89                                 89
 90                              71171
 91                          236122171
 92                             331319
 93                                331
 94                               1319
 95                              36389
 97                                 97
 98                                277
 99                              71143
100                             317047
```
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 3 bytes
```
ΔÒJ
```
[Try it online!](https://tio.run/##HZA7DgIxDAWvYm0dpI0dO0nD9lwBUYBEQUWBhETBJRA3oudKy4TCzZt5zud6O54u5/X@WCbZbGVaHuv3/Xnt1mda95rEkpQkniSS1CQ9SZ6ZzEAzOMMzQgbnxuAoXOEKV7jClQ2KoziKY@wxPBun4Bme4Rme4Rme4RWcglPGVWAF5nSd3Mmd3Mcd6TrcB6frdAMv8AIv8AIe8IAHvMIrvMIqOyo76ngprNFp5I28kTc6jbzT6bAO67AO6@Nr4P3/P/PhBw "05AB1E – Try It Online")
`Δ` run until the output doesn't change:  
`Ò` prime factors including duplicates  
`J` join into an integer
[Answer]
# JavaScript (ES6), ~~58~~ 55 bytes
```
f=n=>n-(g=d=>q=n>1?n%d?g(d+1):d+g(d,n/=d):'')(2)?f(q):q
```
[Try it online!](https://tio.run/##PVE7bttAFOxzim2C3YVsyvvjkjJWqpIyjcvEBUMuZRrSUiJpw0GQGwRIkzK5R87jC@QIyntPoVQIwzdv5s2Qj9VzNdZDd5iuU9/E06kNKazTtdiGJqyPIa3VJr1tNlvRLJRcNQsAV2kZGrniXAotN604ytXxNMTjUzdEwduRy2yIVfO@28W7L6kWNzKb@rtp6NJWyGw87LpJ8E8J1tp@eFfVD2JkYc2@vmHsY7pi8eUQ6yk29yywMQPZ/qJassVSZvvqID487T/HQd6Cpu7T2O9ituu3AvVDBDu2aEWS/x/CxZNtGP/758frr5/wz9mK8dff3/l99th3CTJNXILlN3liTDP8afA3hAwgixOlADmaOUA5rSHraeYBlbiPe@oGJx5YpZCkGTprVChyVogccroERC4KXFRBxsiWNANWk4sBVus5izZzAu3maxpSGe2QJReNCnLBGwZTOQszc/aDPWPmzOaSxfj5mikIgLM5dwNkSWtBYTWxoLCUxSKbzy0tueA1B3eNw25OkQsijWvo50jrEFkqjujSyPk5lTs3QkSNHKCcsuSQJacemDnP0QUb5ZQgx1lBNUDh8R1oBzNPWg97nhLgNW/nRh4TOGLpGs4KevfYvCBFAYrCUl3wKxy9IESkKEBRnlOBorT4xfFblpSqhL2SGnn/Dw "JavaScript (Node.js) – Try It Online")
### Commented
```
f = n =>               // f is a recursive function taking the input n
  n - (                // subtract from n the result of a call to ...
    g = d =>           // ... g: a recursive function taking a divisor d
    q =                //   save in q:
      n > 1 ?          //     if n is greater than 1:
        n % d ?        //       if d is not a divisor of n:
          g(d + 1)     //         increment d until it is
        :              //       else:
          d +          //         append d
          g(d,         //         append the result of a recursive call
               n /= d) //         with n divided by d
      :                //     else:
        ''             //       stop and force coercion to a string
  )(2)                 // initial call to g with d = 2
  ?                    // if it's not equal to n:
    f(q)               //   recursive call to f with n = q
  :                    // else:
    q                  //   we're done: return q
```
[Answer]
# [APL(Dyalog Extended)](https://github.com/abrudz/dyalog-apl-extended), 12 bytes [SBCS](https://github.com/abrudz/SBCS)
```
{⍎⊃,/⍕¨⍭⍵}⍣=
```
[Try it on APLgolf!](https://razetime.github.io/APLgolf/?h=AwA&c=q37U2/eoq1lH/1Hv1EMrHvWufdS7tfZR72JbAA&f=AwA&i=S1MwNOBKUzACYmMgNgFiUyA2A2JzAA&r=tio&l=apl-dyalog-extended&m=dfn&n=f)
A dfn submission which takes a single argument.
[Answer]
# [Bash](https://www.gnu.org/software/bash/), ~~84~~ ~~82~~ 71 bytes
Saved 11 bytes thanks to [caird coinheringaahing](https://codegolf.stackexchange.com/users/66833/caird-coinheringaahing)!!!
```
for((;$1-${2-0};)){ set - `factor $1|sed 's/.*://;s/ //g'` $1;};echo $1
```
[Try it online!](https://tio.run/##TZTdaiNHEIXv9RQnYmA1AUddVd1dXREKgZCnsA27kUdrs2AvHl0YFD27c3rkLCsYadT1c0593TP/fJkf34@b8fx@fHndbHaD3AxnvUmX3TieMU8n3ODz8cvh9PKKQf6dpwd8mre//fr7drubt9huv376zMDuspsOjy@8e7@sVqdpPs37DRSGjIIKR0NAEkQgCjFIhhRIhTikQQKaoAJVqEEztEAr1KENGrAEExhbGizDCqzCHNZggZyQBVmRqZiRC3JFduSGklAERVEMhW4KSkVxFIYCNaEKqqIaakal2YrqqA014AkucIUbPMMLnLM0eKAJmqIZWkYraBWNQza0QCSEIBRhiIwoCEcQQCeQxtX09n06nKaHD0JKJqUPzWHMRMSiFrNWrUjiGsNOfelsbEFnRocinYpUq9aj5EQyxMgWzVLLXqrX5JJZQU5dheWMGpN6Q1NyufbSjjmIp8sRvijH7sLMjg8pvwoyo9fK0ipLqOfifQeYTCzkr9qkpNai52SRyLE4Z/MqVTykMFRqo8egEjsW6cLdB2u4TxzFrh49V7vqazcYPZf9arem3Qwv9tCSShLzBVAT47SkwG8vUtwr@0WkZMVr6Rw4Wl0mWXhxt5QngjOzLOgQizT1OgazKw0NT1VZxoAEEUcu4dJH7Mj6WdDFEn3wXDE/mbaUPUuLosF5WUBQmTtERLSdW9WgUGKzPjHF2b8tsL37rEIki4ll2/iD6021ftBIzLtvtuz8qDWuDo/T4dv0ut@s797@1ru3@ItXWePnv7YeV3ze8YSnZwznX/4/kbd/3l92q4eXFfg57Yfz8iTfDk/3l2Vp3g@bI35eHpf1iak/evzI/v769Hw6Yj3wJfIHhpmFH@Zuh81mmPf7YRrH@8vd85qaz9P7fw "Bash – Try It Online")
Returns the home prime of \$n\$ *quickly* (performs all testcase in less than 2 seconds on TIO).
[Answer]
# [Haskell](https://www.haskell.org/), 79 bytes
```
until((==)<*>g)g
g=read.f
f 1=""
f n=[show p++f(div n p)|p<-[2..],mod n p<1]!!0
```
[Try it online!](https://tio.run/##jVbLbuJAELzzFZMoB0gC8nTPU7LzBfsHLAcU87AWbAvY5JJvX7bbyjk1XJBQubururrMcXv9szud7sfm9/1vf@tO83nTLOrnt8PiMDs0l922Xe1ne2Obx0f56pv19Th8mvHlZT9vuw/Tm3HxNdbLNa1Wm9fz0Oovtd08PFT387brm3aYGbPuXodNvTxvRzNV/Bwu7bV@ejvsbr@6fieI8dL1t6ej6ZpGH9BH78aQgR8SNGMYC8zBWtYKzONqXmABj6ZNI64WBZYhAZ3NVrBWlKbWwp5TNSgvKQWL5bUKcwjDQZhaDyejLDCsm9VqCS9BZ8u4mjQlrBtLU6IiIxEXOYR@1o3Z8jSbL1o9IVsyeZ0tFi2LsLykMCyv7pShe72TalywBaHAP2@BnKWoMC66LHYIxFlnK3Mvgy3Eb1gs8hsnjJLVc0GGCMxheZ0I4gg3FQoOm9xp01AUNQ4Log7xyEjsNRy8xYIojOBoqpvHTL3CHA4khZWdsw9oBy4oLBbZ0hecs8LwOXuBhQouwSkM@y2I3wKhVZHeQsDnPMEC3IJefcB@0xgMCd@fMs1oMpulaYQxSF6aRqyb5lvEtlQjRVd0zhHa0k9NAyDKU/ZGbCRtmvD7VBMpYaZJmCaHk0bkTR6HpcIS2EC26pCEmSZhmiv4XlDdMhX9JcgFt6DVkCDf1YAgHHiigE9GX5QZR01UWIaCyOvDVhWK8crFf@/70/ZwvS/fx/E/ "Haskell – Try It Online")
The relevant function is `until((==)<*>g)g`, which takes as input a number `n` and returns its Home prime.
[Answer]
# [Husk](https://github.com/barbuz/Husk), 6 bytes
```
ω(rṁsp
```
[Try it online!](https://tio.run/##yygtzv6f@6ip8eGOxeb/z3dqFD3c2Vhc8P8/AA "Husk – Try It Online")
```
ω(        # iterate until reaching a fixed point:
     p    #  get the prime factors
   ṁs     #  convert each to a string & concatenate
  r       #  convert the string to a value
```
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal), ~~5~~ 4 bytes
```
‡ǐṅẊ
```
[Try it Online!](http://lyxal.pythonanywhere.com?flags=&code=%E2%80%A1%C7%90%E1%B9%85%E1%BA%8A&inputs=6&header=&footer=)
Jelly really do be getting rekt by stack languages though :p
~~This isn't 4 bytes because strings and integers aren't interchangeable like 05ab1e (and by extension Ohm), but that's okay.~~ I added better type cohesion.
## Explained
```
‡ǐṅẊ
‡ǐṅ  # lambda x: "".join(prime_factorisation(x))
   Ẋ # repeat the above on the input until it doesn't change.
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 14 bytes
```
W!P_Q=QsjkPQ;Q
```
[Try it online!](https://tio.run/##K6gsyfj/P1wxID7QNrA4Kzsg0Drw/38LAA "Pyth – Try It Online")
# Explanation
```
Q     # integer input
W!P_Q # While Q is not prime
=Q    # Set Q to
PQ    # Returns prime factors of Q in increasing order.
k     # Empty string
jk    # Join them
s     # Convert to integer
;     # End of loop
Q     # Print the final value of Q
```
[Answer]
# [Ohm v2](https://github.com/nickbclifford/Ohm), 4 bytes
```
·ΘoJ
```
[Try it online!](https://tio.run/##y8/INfr//9D2czPyvf7/NzECAA "Ohm v2 – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 6 bytes
```
ÆfV$ÐL
```
[Try it online!](https://tio.run/##y0rNyan8//9wW1qYyuEJPv///zc0AAA "Jelly – Try It Online")
This seems oddly long, but the prime factorize built-in is two bytes, I don't think there's a way to bypass needing the `$`, and the loop-until-not-unique built-in is only one byte long for the accumulator version.
[Answer]
# [R](https://www.r-project.org/) + `numbers`, ~~74~~ 73 bytes
```
n=scan();while(F<-el(Reduce(paste0,numbers::primeFactors(n)):0)-n)n=n+F;n
```
[Try it online!](https://tio.run/##BcFbCoAgEADA6@xSgkRfmr8eoBuYLSToJj7o@NtME2HXY2BA@z0pE/hDUYaT7hkJauiD9MqzXNS6MbWlQj7E8bYOjGg0KkZ2vHjLsu3yAw "R – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 12 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
@=k ¬n)j}a;U
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=QD1rIKxuKWp9YTtV&input=WzEwLDExLDEyLDEzLDE0LDE1LDE2LDI0XS1t)
```
@...}a  - first number to return a truthy value when passed trough:
@=        > ignore input and assign 1st input U : *
k ¬n)       * prime factors of U joined and converted to a number
j         > return(is prime?)
;U      - print U
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 11 bytes
```
j ?U:ßUk ¬n 
j ?         // If the input is prime
   U        // we're done, return the input.
    :       // Otherwise,
     ß      // recursively rerun
      Uk    // with the input's prime factors
         ¬n // joined together as a string and parsed to a number.
```
[Try it here.](https://ethproductions.github.io/japt/?v=1.4.6&code=aiA/VTrfVWsgrG4=&input=MTA=)
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 37 bytes
```
{`.+
$*_
+`(__+?)(\1)*$
$.1_$#2$*_
_
```
[Try it online!](https://tio.run/##HY0xTsVADAX7uQZByv@Rvtb22t6tKLkEUkJBQUOB6Dh8cOie5mk03x8/n1/v5/P6epy/x2Njue9sx7rv28ttfZPbfWF5yL486fXsnKdidJwgYSINEUQRQzriIIkMZIIKqqjVcjTQRAc6sYYJmGEdK8cSG1g5XehKL4ce9IrgDRdcccOr7XjgiQ98Eo0QQonLiSCSGMQkG1mVNLKTValdBYYyjNEZ/2xcjGnMziwykzngDw "Retina 0.8.2 – Try It Online") Somewhat slow, so link only includes faster test cases. Explanation:
```
{`
```
Repeat until the fixed point.
```
.+
$*_
```
Convert to unary.
```
+`
```
Repeat until all prime factors have been found.
```
(__+?)(\1)*$
```
Find the lowest factor of the remainder.
```
$.1_$#2$*_
```
Prefix the decimal of the factor to the quotient, thus concatenating it to the factors found so far.
```
_
```
Delete the trailing unary `1`.
[Answer]
# [Python 3](https://docs.python.org/3/), 109 bytes
```
def f(n,m=0):
 while n-m:
  l=m=n;n=0
  for i in range(2,l+1):
   while l%i<1:n=int(f'{n}{i}');l/=i
 return n
```
[Try it online!](https://tio.run/##RZTdbtswDIXv8xS6GRJjLiaKkii1c19k28WQOaux1A0cF/sJ8uzZIe1uFzac8CN5eCjo9Ht@ehn5dvvWH9xhN7bPnW/uN@7n03Ds3Xj3jG937J678WHsPL4PL5Mb3DC66ev4vd@F9vieNMGtKcd3w0e6H7thnHeH7WW8Xobrtnk4fuiGjZv6@XUa3Xib@/N8dp1DvuPWxdal1uXWSetK62rryOMhPAAIBAEhMASIQBEwAhfABXABXAAXwAVwAVwAF8AFcAyOwbE2BMfgGByDY3AMjsFFcBFcBBdVGbgILoKL4CK4BCaBSWASmKTywSQwCUxSBrUyuAwug8vgMrisc4LL4DK4DE7ACTgBJ@AEnIATNQSMgCmIF8QL4gXxgnhBvKhjYAqYijoVXAVXwVVwFVwFU9VW89U3m/7Xqd/P/bf/CwjqdVosVDeYiYhrTswlcyKvfyojKpDMcF43w6zDEJnNlDmzMWq@Oq1bQrnCvkRJWbIXipqotltfrQSClbT6HNTetXCwNVa1WZYdhkhB/TJByKv/2suqQkErREvpSDVITGIb1iS1VNcbQqHkS6kGRqIa6zqbdsuUSSolhFMu0F/RWYsnMi0mT1P1GGBafhtAYuY3UcHEV8vS6tlUBxOpL5QMySdPLIunhRi@wDG8JVESyShdq/ecJCdzTEfPy5iLv7r4oKdPnUF2JZ1xEaP9zTDm1bhQxeegBTRIFcupMVUh9cAcXo5aWGSSvrNHmudQfJRIpaZQYUlM5mnEhmElZoklh4qeHiXNEEjRRmXZj5j8TPBtkbTsndk2bp@Z7TSruWIDUbRdCho3m/1Tv//RT3p2t59f0W@/bZ19EW@bjd5Pc9vrDfVnOO3somnd24lfbio3HNyxH3fnedr1TfMo9/uXcR7G196iejEddnNjP07TepPNV3f36C7nq7usEj71XXf@gtvt9hc "Python 3 – Try It Online")
*Quite* verbose, returns the home prime of \$n\$.
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 60 bytes
```
#//.x_:>FromDigits[ToString/@(""<>Table@@@FactorInteger@x)]&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n277X1lfX68i3srOrSg/1yUzPbOkODokP7ikKDMvXd9BQ0nJxi4kMSkn1cHBwS0xuSS/yDOvJDU9tcihQjNW7X9gaWZqiUMAUHGJgkN6tIV57P//AA "Wolfram Language (Mathematica) – Try It Online")
-14 bytes from @att
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 5 bytes
```
usjkP
```
[Try it online!](https://tio.run/##K6gsyfj/v7Q4Kzvg/38zUwA "Pyth – Try It Online")
Pyth could tie 05AB1E if it had a "join into integer" byte, or Ohm if it could take the primes factors of a string. Beats Jelly even without them, which surprises me.
[Answer]
# [Arturo](https://arturo-lang.io), 49 bytes
```
$->n[until->prime? n[n:do join factors.prime n]n]
```
[Try it](http://arturo-lang.io/playground?NGHXtI)
Really useful:
* `join [12, 3, 45]` -> `"12345"`
* `do "12345"` -> `12345`
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 88 bytes
```
param($n)while($n-ne$m){$m=$n;$n=[int](((factor $m)-replace"^\d+: ").split()-join"")};$n
```
[Try it online!](https://tio.run/##Dcs9CsMwDEDhqwSjQaI4Q7em5CT9AZOqxEGWjWPIUHJ21duDj1fywXVfWcSshBoSgtKxRuEeXhkS/SDNoHfQ@RG1vRDxG5aW69DNVy4SFnbv5@cyDY7GvUhsSH7LUZ2js39mdrv@AQ "PowerShell – Try It Online")
Well, I'm lazy, just ported @Noodle9
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 203 bytes
```
param($k)$s='$f;$n/=$f';function F($n){$m=[math]::sqrt($n);$f=2;while(!($n%$f)){iex $s};$f=3;while($f-le$m-and$n-ge$m){while(!($n%$f)){iex $s};$f+=2};$n};while($k-ne$g){$g=$k;$k=[int]((F($g))-join'')};$k
```
[Try it online!](https://tio.run/##dY7RCsIgGIVfZcEfKiHBuirxtpcYu5DSzdR/axoLxp7dHNRlV@dwPj444zDrKfba@5xHNalAwTGIkoARgEcJhgjzwluyA1ZXCsgWCLIJKvXt5RKfU9o2AUbWYu6t13RXhj0Yxhar3xXEdYOnLwTDvYbAFd4BeVcqW/5rB1mXwPUnO44auvKgk@AEONlYTC2l5VfHGH8MFglhRXE553P9AQ "PowerShell – Try It Online")
This one has some thought put into it...
`F()` is a function that returns the prime factors of a number, it works like
1. Handle 2 as a prime
2. Then brute force odd numbers
3. Stop when the factor to test exceeds the square root of the number, or the remaining quotient is less than the square root of the number
[Answer]
# [Scratch](https://scratch.mit.edu), 320 bytes
[Try it online!](https://scratch.mit.edu/projects/515528202)
Numbers that use values greater than 1 sextillion break because Scratch automatically converts them to scientific notation. Alternatively, 38 blocks.
```
when gf clicked
delete all of[P v
ask()and wait
set[N v]to(answer
repeat until<(length of[P v])=(1
repeat(length of[P v
set[N v]to(join(item(length of[P v])of[P v])(N
delete(length of[P v])of[P v
end
repeat until<(N)=(1
set[F v]to(2
repeat until<((N)/(F))=(round((N)/(F
change[F v]by(1
end
set[N v]to((N)/(F
add(F)to[P v
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 10 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
@j}a@=k ¬n
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=QGp9YUA9ayCsbg&input=MjQ)
# [Japt](https://github.com/ETHproductions/japt) [`-h`](https://codegolf.meta.stackexchange.com/a/14339/), 6 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
Assumes that it takes no more than `n` iterations to reach `p`.
```
Æ=k ¬n
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LWg&code=xj1rIKxu&input=MjQ)
[Answer]
# [Scala](http://www.scala-lang.org/), ~~233~~ 212 bytes
saved 21 bytes thanks to the comment of @The Thonnu
Golfed version, [try it online!](https://tio.run/##ZZHRatswGIXv/RQ/JgMJFM@ylrhxqrJRejFwctPuauxC9RRXQ5GCJTo6kzfY3W63l@uLZL8cug1mEBKH8x3J5w@dsurk77/oLsJGGQfjKT4dNLSy9a7PPusd7IhrWrZvWlnSJqlyfBsSVyjnfFTReFdEZeygO0hA/wKgXRrEpdxTB9oGPT6qATbSrdO@lWU7HazcrHd@IOZyXkH0YIvo37tIvz4Yq4l9ZSRePW7lFvXbOBjXF513nYrE/FEontLj1va1NMd1T7ZsQ9Pu2J4eT@lde/w/ooY@NO@GQT19PIOfaPPBmSjH7FFZuJOtCZFUDASDNwwWDJYMagYXDFYMeImL40IDRwdHC1/QCb35F62SC@FKTLQQgnMuVsuFEBdLseBl3aKaTHUtzplV8k6hQizrpFWrc/L1OTl//vU9Z5A///yR0wwLA0IiA03hcg53xTdzIDeUwphh5/pvVVa7Pj5ccawwO6ASrSMhn0WYX2HZHu5Nj3HHaTzTdQEkDj3S/9yzALPxmpgdEC1loMCnoUJJjykBv9Nv)
```
type L=Long
def f(n:L,m:L=0):Long={@scala.annotation.tailrec def g(n:L,m:L):L=if(n==m)n else{var M=n;var N=0L;var l=M;for(i<-2 to l.toInt)while(l%i==0){N=N.toString.concat(i.toString).toLong;l/=i};g(N,M)};g(n,m)}
```
Ungolfed version
```
import scala.annotation.tailrec
object Main {
  def f(n: Long, m: Long = 0): Long = {
    @tailrec
    def innerF(n: Long, m: Long): Long = {
      if (n == m) n
      else {
        var newM = n
        var newN = 0L
        var l = newM
        for (i <- 2 to l.toInt) {
          while (l % i == 0) {
            newN = newN.toString.concat(i.toString).toLong
            l /= i
          }
        }
        innerF(newN, newM)
      }
    }
    innerF(n, m)
  }
  def main(args: Array[String]): Unit = {
    val tests = List(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)
    val expected = List(2, 3, 211, 5, 23, 7, 3331113965338635107L, 311, 773, 11, 223, 13, 13367, 1129, 31636373, 17, 233, 19, 3318308475676071413L)
    val checker = List("❌", "✓")
    for ((t, e) <- tests.zip(expected)) {
      if (e.toString.length > 10) {
        println(s"$t -> too big")
      } else {
        val s = f(t)
        println(s"$t -> $s ${checker(if (e == s) 1 else 0)}")
      }
    }
  }
}
```
]