is a US Federal health Insurance program administered by the United Federal government, providing health insurance coverage to people who are aged 65 and over, or who meet other special criteria.
If you are a new immigrant aged 65 and above, and been a permanent resident for 5 years or more, you may purchase Medicare from the government.
So it is true that you have to be a citizen over 65 or green card holder who live in US for more than 5 yrs to receive Medicare. 40 QUARTERS ARE NOT REQUIRED.
Hope this helps.