How do I add numbas variable values into pattern restrictions?
I want to get students to fully factorise an expression like (8x+12xy), i.e. 4x(2+3y)
To do this I am trying to use pattern restriction, where the pattern needs to have the numerical gcd . x out the front. The gcd is a randomly selected number held in a variable and I cannot figure out how to make this work.
In order to try to figure it out I set up a simpler problem: the answer should be 6 + k, where 6 is held in a number variable {tc}
I tried $n;c + k `where c={tc} and other variations but I haven't succeeded so far in getting the pattern match to work, and would appreciate some help.