<s>[INST] Write a product of two numbers in non decimal base If $A=(b-1) (b-1) (b-1)$ and $B=(b-1) (b-1)$ are written in base $b$, what is $A\times B$ in base $b$? 
I've tried developing $A \times  B$ in decimal base but couldn't get this product back in base $b$.
Beside this, is there a general procedure to compute product in non decimal base.
Thanks in advance for your help,
 [/INST] Your two numbers as the largest possible three digit and largest possible two digit number written in base $b$. I.e. they are $1000_b-1_b$ and $100_b-1_b$. Algebraically these are equal to $b^3-1$ and $b^2-1$ respectively. As such their product will be given by:
$$(b^3-1)(b^2-1)=b^5-b^3-b^2+1$$
This however has negatives in it so its hard to read it as a base $b$ number. Lets manipulate until it is all positive values multiplied by powers of $b$.
$$=(b-1+1)b^4-b^3-b^2+1$$
$$=(b-1)b^4+b^4-b^3-b^2+1$$
$$=(b-1)b^4+(b-2+2)b^3-b^3-b^2+1$$
$$=(b-1)b^4+(b-2)b^3+2b^3-b^3-b^2+1$$
$$=(b-1)b^4+(b-2)b^3+b^3-b^2+1$$
$$=(b-1)b^3+(b-2)b^3+(b-1+1)b^2-b^2+1$$
$$=(b-1)b^3+(b-2)b^3+(b-1)b^2+b^2-b^2+1$$
$$=(b-1)b^3+(b-2)b^3+(b-1)b^2+1$$
This is now a sum of positive numbers times a power of $b$ so we can read off the coefficients to give up the digits in base $b$. So the digits in your product are $b-1$, $b-2$, $b-1$, $0$, $1$. E.g. in base 10 it would be 98901, in base 4 it would be 32301, etc.
</s>