How to find the corresponding APR to a given APY?
The length of the CD is not relevant. The point of APR and APY numbers is that they annualize the rate you pay over a time frame that may be smaller or larger than a year. What matters is the compounding frequency. CDs generally compound on either a daily or monthly basis, so n will be 12 or 365, depending on the CD.
Is this a real-life problem or an homework/practice question? If it's the latter, you should probably assume n=12 because teachers seldom want you to mess with daily compounding without also telling you how many days you should assume there are in a year for compounding purposes.