Of course if n < 3 answer is 0.

I would do number of ways to color n objects with 3 colors without restriction, then subtract out those that don't use every color at least once. (Two cases: 2 colors are used, 1 color is used.)

Edit: Actually what I wrote in parentheses above is a bit misleading, you'd want to use inclusion-exclusion when counting ways with at most 2 colors (as opposed to exactly 2 colors) compared with 1 color.