Skip to main content

View Diary: Perhaps a simpler way to find out if a number is prime. (44 comments)

Comment Preferences

  •  And how does your method know that (0+ / 0-)

    for example, 31 or 61 are primes, without being told? Either it doesn't, or you've left something out.

    Here's a hint: watch the animation at the wikipedia link above and think about how, once the program running the animation finds out that 11 is prime, it can fill in all the other primes on the chart with purple, without touching any other previously visited numbers - no multplying anything by 11 is necessary*, which is faster than the method you've described. It isn't necessary to test any of the "purple" primes in any way - the program already "knows" they're prime.

    *Except that 11 X 11 = 121

    It's never too late to have a happy childhood - Tom Robbins

    by badger on Mon Dec 05, 2011 at 04:48:03 PM PST

    [ Parent ]

    •  Did you try really try and understand (0+ / 0-)

      my idea? " for example, 31 or 61 are primes, without being told? Either it doesn't, or you've left something out."divide every odd number by the number  3 then since 5*5 the first prime after 3 is the first non prime number that ends in a .333 or .666 then every number that ends in a .333 or .666 is prime you multiple all the numbers that end in .333 or .666 by themselves and by the other numbers so yes 31 is prime because 7 the next prime number * 5 = 35 therefore 31 is prime. Just follow the steps. I will try and explain this better if I decide to do a next time. I am still studying your links.

Subscribe or Donate to support Daily Kos.

Click here for the mobile view of the site