-
I made a few changes to your script groovy and I added a feature that makes it so if you press space it alternates between showing the prime number calculations and the difference between prime numbers. I did this because I was curious whether or not there was some kind of pattern. I've also increased the frame rate to 120 to make it go as fast as possible.
-
the correct way to find prime number is to run till the sqrt of the number
Code:
//set a number to test for prime
num = 17;
till_num = Math.sqrt(num);
for(i=1;i<=till_num;i++){
calc = num%i;
if(calc == 0 && i != num && i != 1){
trace("number is not a prime");
//if true, then the number is not prime and stop checking
break;
}
}
trace(num+' is prime')
this is for sure better then the last 2 seggestions
-
nice!
My script was just a brainstorm to see if I could do it. After reading more about the riemann hypothesis and the work that mathematicians have been doing trying to solve it, I realize this script is like a hundred years behind the research.
It's basically useless, but was just a fun little gadget.