# AMC10B 2004!

Let $$1,4,\ldots$$ and $$9,16,\ldots$$ be two arithmetic progressions. The set $$S$$ is the union of the first 2004 terms of each sequence. How many distinct numbers are in $$S$$?

×