Difference between "per" and "a"

Solution 1:

A in that sense is a preposition meaning the same thing as per. Any dictionary will have that as a definition for a (Dictionary.com):

preposition
each; every; per: ten cents a sheet; three times a day.

Oxford Dictionary Online and Merriam-Webster have similar entries.

So there is no difference in meaning between your examples. As to usage differences, per is characterized as being more formal and careful, so you would see it more in academic or legal writing or precise instructions, while a would be more common in speech and normal writing.

Solution 2:

Strictly speaking, "per" and "a" are equivalent in OP's examples (effectively, meaning "in each", or "in every"), but it's worth pointing out that using "per" like this has overtones of science/academia, business/commerce jargon, legalese, etc., often implying a "commitment to accuracy".

Thus we wouldn't be surprised to discover that she (Little Red Riding Hood?) usually goes to the forest three times a week as a casual activity of her own choice (to pick flowers or whatever), where it's quite possible she actually goes twice or four times some weeks.

But if we're told she goes three times per week, that suggests a more formal arrangement. Perhaps because Granny will be taken into care if the family can't keep up a regular schedule of home visits to make sure she gets enough cake to eat, for example.

Solution 3:

They are both right, but a is more common.

per (preposition)

: with respect to every member of a specified group : for each

a (preposition)

: in, to, or for each