Medicare Part A premiums aren't deductible if you're covered under Social Security or if you're a government employee who paid Medicare tax.
However, if you aren't covered under Social Security (and you aren't a government employee who paid Medicare tax) and you voluntarily enrolled in Medicare A, you can deduct those premiums.
Premiums for the other Medicare programs—Part B (supplemental medical insurance), Part C (Medicare Advantage), and Part D (voluntary prescription drug insurance)—are deductible.