0 0 randRange( 2, 12 ) getPrimeFactorization( N )

The best thing is to do a prime factorization of this number and look for groups of numbers.

Let's draw a factor tree.

init({ range: [ [-1, FACTORIZATION.length + 2], [ -2 * FACTORIZATION.length - 1, 1] ], scale: [30, 30] }); label( [cx + 1, y], curr );
path( [ [cx + 1, y - 0.5], [cx, y - 1.5] ] ); path( [ [cx + 1, y - 0.5], [cx + 2, y - 1.5] ] ); y -= 2; cx += 1; curr = curr / factor; label( [cx - 1, y], factor ); circle( [cx - 1, y], 0.5); label( [cx + 1, y], curr );
circle( [cx + 1, y], 0.5);

So we found that the prime factorization of Q is PRIMES.join( "\\times " ).

N * N getPrimeFactorization( Q ) PRIMES.slice( 0, PRIMES.length - 1 ) Q

What is the square root of Q?

N

We're looking for the square root of Q, so we want to split the prime factors into two identical groups.

We only have two prime factors, and we want to split them into two groups, so this is easy.

Q = PRIMES.join( "\\times " ), so N^2 = Q.

Notice that we can rearrange the factors like so:

Q = PRIMES.join(" × ") = \left(F_N.join( "\\times " )\right) \times \left(F_N.join(" × ")\right)

So \left(F_N.join( "\\times " )\right)^2 = N^2 = Q.

So N^2 = Q.

So the square root of Q is N.

N * N * N getPrimeFactorization( Q ) PRIMES.slice( 0, PRIMES.length - 1 ) Q

What is the cube root of Q?

N

We're looking for the cube root of Q, so we want to split the prime factors into three identical groups.

We only have three prime factors, and we want to split them into three groups, so this is easy.

Q = PRIMES.join( "\\times " ), so N^3 = Q.

Notice that we can rearrange the factors like so:

Q = PRIMES.join( "\\times " ) = \left([ F_N.join( "\\times " ), F_N.join( "\\times " ), F_N.join( "\\times ") ].join( "\\right)\\times\\left(" )\right)

So \left(F_N.join( "\\times " )\right)^3 = N^3 = Q.

So N^3 = Q.

So the cube root of Q is N.