Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #399425

Re: prime number distribution multiples of 6

From Martin Brown <|||newspam|||@nezumi.demon.co.uk>
Newsgroups sci.electronics.design
Subject Re: prime number distribution multiples of 6
Date 2016-02-19 09:38 +0000
Organization Aioe.org NNTP Server
Message-ID <na6nss$qmi$1@gioia.aioe.org> (permalink)
References <na5cka$130f$1@gioia.aioe.org> <na5ee1$15lp$1@gioia.aioe.org> <958cccb3-f055-460b-a7a0-54d00a535fc0@googlegroups.com>

Show all headers | View raw


On 18/02/2016 22:02, Wanderer wrote:
> On Thursday, February 18, 2016 at 4:52:09 PM UTC-5, Jamie M wrote:
>> Hi,
>>
>> In case you don't understand what I'm talking about:
>>
>>
>> { Name = 1, Count = 1 }
>> { Name = 2, Count = 3424506 }
>> { Name = 4, Count = 3424679 }
>> { Name = 6, Count = 6089791 }
[snip]
>>
>>
>> ie for name=6 count is greater than name =4 and name =8 (the ones
>> before and after) and all name=6multiples (ie 12,18,24,30) have a count
>> greater than the one right before and after too count is how many times
>> primes occurred with a gap of "name" in the sequence.
>
> The prime number 6 thing is old news.
>
> https://www.quora.com/Why-do-prime-numbers-always-satisfy-the-6n+1-and-6n-1-conditions-Is-there-any-mathematical-logic-behind-it


It provides one means to do a quick lookup table of bits to compute 
"isprime" quickly for a given number P since dividing P-1 by 3 maps all
the numbers apart from 2 that might be prime onto consecutive integers.

P = 3    -> (P-1)/3 = 0
P = 6n-1 -> (P-1)/3 = 2n-1
P = 6n+1 -> (P-1)/3 = 2n

I once used this trick on a puzzle in SciAm Mathematical games using an 
Epson V30 PC. I came third beaten by a Cray and CDC using brute force.

Having a series of 65536 bit (aka 8kb) long lookup tables for primality 
speeded up the problem by orders of magnitude. Back in the days when 
memory was expensive and 640k was thought to be "enough for anybody".

-- 
Regards,
Martin Brown

Back to sci.electronics.design | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

prime number distribution multiples of 6 Jamie M <jmorken@shaw.ca> - 2016-02-18 13:21 -0800
  Re: prime number distribution multiples of 6 Jamie M <jmorken@shaw.ca> - 2016-02-18 13:51 -0800
    Re: prime number distribution multiples of 6 Wanderer <wanderer@dialup4less.com> - 2016-02-18 14:02 -0800
      Re: prime number distribution multiples of 6 Jamie M <jmorken@shaw.ca> - 2016-02-18 15:06 -0800
      Re: prime number distribution multiples of 6 Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2016-02-19 09:38 +0000
        Re: prime number distribution multiples of 6 Wanderer <wanderer@dialup4less.com> - 2016-02-19 07:46 -0800
  Re: prime number distribution multiples of 6 Sylvia Else <sylvia@not.at.this.address> - 2016-02-20 18:34 +1100
    Re: prime number distribution multiples of 6 Jamie M <jmorken@shaw.ca> - 2016-02-20 03:12 -0800
      Re: prime number distribution multiples of 6 Sylvia Else <sylvia@not.at.this.address> - 2016-02-20 23:07 +1100
      Re: prime number distribution multiples of 6 DecadentLinuxUserNumeroUno <DLU1@DecadentLinuxUser.org> - 2016-02-20 13:17 +0000
    Re: prime number distribution multiples of 6 DecadentLinuxUserNumeroUno <DLU1@DecadentLinuxUser.org> - 2016-02-20 13:09 +0000

csiph-web