Prime pattern 6 +/- 1
#1
Here's something I noticed the other day, which I thought might interest you, since you've written a ton of programs regarding prime numbers -- most primes tend to be multiples of 6, +/- 1!

5 is 6 -1
7 is 6 + 1
11 is 6 * 2 -1
13 is 6 * 2 +1
17 is 6 * 3 -1
19 is 6 x 3 +1
... and so on.

I don't know how far the pattern continues (past 100, I think), but you might want to play with it some and see how it holds up in general.  It may be a quicker way to generate a list of primes than using the Sieve which I've seen you implement often in the past.  My ass is still kicked from my last doctor's visit and all, and I'm not up to coding on it at the moment, but I figured I'd share the observation in case it interested you. Wink
Reply


Messages In This Thread
Prime pattern 6 +/- 1 - by SMcNeill - 06-30-2022, 10:49 AM
RE: Prime pattern 6 +/- 1 - by bplus - 06-30-2022, 12:25 PM
RE: Prime pattern 6 +/- 1 - by bplus - 06-30-2022, 12:29 PM
RE: Prime pattern 6 +/- 1 - by david_uwi - 06-30-2022, 12:46 PM
RE: Prime pattern 6 +/- 1 - by bplus - 06-30-2022, 01:32 PM
RE: Prime pattern 6 +/- 1 - by david_uwi - 06-30-2022, 02:39 PM
RE: Prime pattern 6 +/- 1 - by triggered - 07-01-2022, 11:29 AM
RE: Prime pattern 6 +/- 1 - by SMcNeill - 07-01-2022, 11:40 AM
RE: Prime pattern 6 +/- 1 - by bplus - 07-01-2022, 12:51 PM
RE: Prime pattern 6 +/- 1 - by bplus - 07-01-2022, 01:06 PM
RE: Prime pattern 6 +/- 1 - by bplus - 07-01-2022, 01:15 PM
RE: Prime pattern 6 +/- 1 - by david_uwi - 07-01-2022, 03:55 PM
RE: Prime pattern 6 +/- 1 - by triggered - 07-07-2022, 10:46 AM



Users browsing this thread: 6 Guest(s)