i don't know if i have correctly spelled is name but lets call him Era

so Era was the guy who had the idea to find out the prime number by crossing all the multiple of the smallest number he had not crossed yet (exept one) till he has reach a certain number, assuming this smallest number was a prime number, reapeting the operation till all the numbered are crossed or marked as prime ( i supose you allready know the story )

the problem is that at the time he was leaving near the sea and a sandy beach and as theyre were no paper he had draw a you know what on the sand and he had to carry big and heavy stones to marks all those numbers

so here is the mathématical riddle:

when Era wants to mark the multiples of the nème primes number (lets say one is the first) and wants to do it for all the multiples <= M, how many stones does he need to carry considering this is no use to mark one place with more than one stone

this is to check my solution (i consider it wont give you any help whit the problem of checking if i'dd wrote my own solution )