Calculate whether a number is prime, else it's factors. Use q to toggle whether or not to search for all of the factors of the number. (On is default) Big numbers (numbers that are 13+ digits long) may take a LONG time to calculate (up to several minutes), so don't be surprised if it doesn't seem to work. Use this for a faster version: https://sulfurous.aau.at/#72303532 On sulfurous the variable that shows progress doesn't work.
I wrote some code in C, for my arduino mega, that did something similar to this, and decided to make it on scratch. ▬▬▬Updates▬▬▬ V1.11.0 05-14-2025 Improved the speed for calculating if a number is not prime. Improved the comments and prompts. V1.10.1 10-14-19 Fixed some typos and other minor details V1.10.0 6-24-19 Fixed things that changed in Scratch 3 V1.9.1 2-23-18 Fixed the progress indicator not changing from 0. V1.9.0 1-29-18 Added a new feature of not having to search for factors. Instead, quitting as soon as a factor is found. This makes searching for primes faster. V1.8.0 11-2-17 Added a progress indicator. V1.7.0 10-26-17 Made clicking continue. (Instead of just pressing space) V1.6.3 7-11-17 Changed how the time taken to calculate is acquired. V1.6.2 5-18-17 Changed how the code rejects invalid inputs. V1.6.1 5-9-17 Fixed it so it won't repeat the factor that is the square root. V1.6.0 5-8-17 Dramatically speed up the calculations! However the factors are no longer in order. Any feedback on this? V1.5.8 12-5-16 Removed some outdated code. V1.5.7 11-11-16 Fixed output for certain conditions. V1.5.6 11-10-16 -Increased speed(?) very very slightly ~ 0.0005 seconds -Removed sounds (now down to 2 assets) :) V1.5.5 9-22-16 -Improved output text. -Fixed a small problem. V1.5.4 7-7-16 Slight improvements. V1.5.3 6-3-16 0.2 seconds faster. (on my computer) V1.5.2 5-23-16 Even faster. V1.5.1 5-19-16 Even faster (putting more blocks under the custom block). V1.5.0 5-5-16 Made it even faster using a custom block. V1.4.1 5-2-16 Changed the looks of the calculator again. (very slight change) V1.4.0 2-6-16 Changed the calculator's looks. V1.3.0 9-28-15 Made it about twice as fast as it was before! V1.2.0 8-29-15 -Fixed a HUGE bug I made when trying to speed it up and fixed it saying letters are prime. V1.1.0 Added time of how long it took to find answer. V1.0.0 Released!