Implement a ternary number representation interactive, similar to the binary one, with powers of three and toggles for 0, 1, or 2 copies of each number, up to the seventh power of 3. Include a random number generator up to 3280.