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

If you can't think of that number, you can break down Q into its prime factorization and look for equal 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 the prime factorization of Q is PRIMES.join( "\\times " ).

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

What is \sqrt{Q}?

N

\sqrt{Q} is the number that, when multiplied by itself, equals Q.

We're looking for \sqrt{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 \sqrt{Q} is N.