Now if your lab partner determined that there were 5.001 x 1022 atoms of K in an unknown sample of KMnO4, how many milligrams would the unknown sample weigh?

5.001E22/6.022E23 = mols K atoms.

mols K atoms = mols KMnO4 molecules.
grams KMnO4 = mols KMnO4 x molar mass KMnO4, then convert to mg.