After a joyous and restful three days, I left this beautiful city.
The phrase a joyous and restful three days can be changed to a joyous and restful period of three days. Now we're talking about a period, not a three days. Let's change joyous and restful to just nice.
After a nice three days, I left this beautiful city.
Dropping the a makes it ungrammatical. You can reword it as:
After three nice days, I left this beautiful city.
However, the meaning could be slightly different. Maybe I was there for a week but only three of the individual days were nice. In the original sentence using the adjectives before the number makes it clear that the three days are a group and so the indefinite article is required. That being said, you would most likely find this formation in writing rather than speech.
If you mention the nice days in an earlier sentence you could say:
I spent three nice days here. After the nice three days, I left this beautiful city.
or
I spent three nice days here. After the three nice days, I left this beautiful city.
As for why a is mandatory, it's the same as I saw a cat. It's ungrammatical to drop the a in that sentence too.
You can say
Three fat boys ate
but not
A fat three boys ate
because it doesn't make sense to call the group fat, only the individuals.
Three noisy boys ate
A noisy three boys ate
In the first sentence each of the boys is noisy. In the second sentence the group as a whole is noisy but not necessarily every boy. It's possible for an individual boy within the group to not be noisy.
So the construction you asked about only works if each adjective can be applied to a group.
3If you think of three days as a three day period (of time), then using "a" makes sense. – user3169 – 2015-03-27T22:18:33.857
3+1 This is a really interesting point of English grammar that I have never noticed before. – WinnieNicklaus – 2015-03-27T22:52:36.930
Consider: "[a joyous and restful] three days". Also, "[a happy] three days", "[a good] three hefty steaks". I think there have been prior questions on this topic, either here on ELL and/or also on EL&U. – F.E. – 2015-03-28T00:40:48.510
1In the 2002 CGEL, page 339: "In general, a selects a count singular noun: a cup, but not * a crockery. Would you like a chocolate? therefore yields a count interpretation of chocolate. Under restricted conditions, however, a can combine with a non-count singular: …" -- Notice that in your example that you have a count plural noun ("days"), and so, that probably ought to strongly imply that the "a" in your example is not functioning as the determiner for that count plural noun. – F.E. – 2015-03-28T09:15:12.317
1Some more possibly related CGEL pages: 339 [21], 353 [69-70], 372-3 [11-13]. – F.E. – 2015-03-28T09:51:53.590
1Part of your problem is that the following is untrue: when a noun, even though in the plural, is used to mean a certain amount or quantity of something, grammatically there should be an indefinite article placed in front of it. – None – 2015-03-28T23:29:29.777