So umm this is very different from my usual project type. I was on a mobile so I didn't manage to make it look good or anything. May go back and do that later. I believe this will go up numbers and see if they are prime. Let me know if it goes wrong. Please don't let it go on infinitely because I think it will end up crashing either your computer or scratch. If I do find it does crash things this I will make it so it cam only go on for so long or see if I can change the speed it does it at or something.
I am very aware that people way have made this same thing using pretty much the same code as it is pretty simple. I didn't copy of anyone, this was all from my own head but it is a pretty simple method and lots of people know it. If you need proof that I didn't take anyone's code then you should know, I made this on my phone and it won't let me see inside anyone else's projects. If there is someone who did the same method as me comment a link to it and I'll add it to the description because I don't want to take credit away from anyone else who has done this. I think I originally made something like this with my dad when I was younger on a different programming language. So thanks to my dad. Also thanks to my maths teacher for teaching me all kinds of cool stuff. I just changed something which should mean that it does half the number of calculations.