To help you find the bag of fake coins, you have a digital scale which will give you the exact weight of any amount of coins up to 1500 grams. Any amount over 1500 grams will cause the scale to spit out a random value.

How many bags (N) can you have and still be able to tell which bag contains the fake coins if you can only use the scale three times?