<divclass="rosetta"><pclass="rosetta__paragraph"><spanclass="rosetta__text--bold"><aclass="rosetta__link--wiki"href="https://en.wikipedia.org/wiki/FRACTRAN"title="wp: FRACTRAN">FRACTRAN</a></span> is a Turing-complete esoteric programming language invented by the mathematician <aclass="rosetta__link--wiki"href="https://en.wikipedia.org/wiki/John Horton Conway"title="wp: John Horton Conway">John Horton Conway</a>.</p><br/><pclass="rosetta__paragraph">A FRACTRAN program is an ordered list of positive fractions $P = (f_1, f_2, \ldots, f_m)$, together with an initial positive integer input $n$.</p>
<br/><pclass="rosetta__paragraph">The program is run by updating the integer $n$ as follows:</p><br/><ulclass="rosetta__unordered-list"><liclass="rosetta__list-item--unordered">for the first fraction, $f_i$, in the list for which $nf_i$ is an integer, replace $n$ with $nf_i$ ;</li>
<liclass="rosetta__list-item--unordered">repeat this rule until no fraction in the list produces an integer when multiplied by $n$, then halt.</li></ul>
<br>
<pclass="rosetta__paragraph">Conway gave a program for primes in FRACTRAN:</p><br/><pclass="rosetta__paragraph"><spanclass="rosetta__text--indented"> $17/91$, $78/85$, $19/51$, $23/38$, $29/33$, $77/29$, $95/23$, $77/19$, $1/17$, $11/13$, $13/11$, $15/14$, $15/2$, $55/1$</span></p><br/><pclass="rosetta__paragraph">Starting with $n=2$, this FRACTRAN program will change $n$ to $15=2\times (15/2)$, then $825=15\times (55/1)$, generating the following sequence of integers:</p><br/><pclass="rosetta__paragraph"><spanclass="rosetta__text--indented"> $2$, $15$, $825$, $725$, $1925$, $2275$, $425$, $390$, $330$, $290$, $770$, $\ldots$</span></p><br/><pclass="rosetta__paragraph">After 2, this sequence contains the following powers of 2:</p><br/><pclass="rosetta__paragraph"><spanclass="rosetta__text--indented">$2^2=4$, $2^3=8$, $2^5=32$, $2^7=128$, $2^{11}=2048$, $2^{13}=8192$, $2^{17}=131072$, $2^{19}=524288$, $\ldots$</span></p><br/><pclass="rosetta__paragraph">which are the prime powers of 2.</p>
<pclass="rosetta__paragraph">Write a function that takes a fractran program as a string parameter and returns the first 10 numbers of the program as an array. If the result does not have 10 numbers then return the numbers as is.</p></div>