Prime pattern 6 +/- 1
#12
It's a very long time since I wrote that program. It looks a bit complicated, but basically it starts with an array (50 million binary digits - because we are only doing the odd numbers) all the binary digits are initially zero. Then it goes through setting every 3rd digit one then every 5th digit to one then every 7th... It wont do 9 as it is reading the next zero digit in the array (and 9 has been struck out by the 3 sieving).
I use only integer division and +, - (and mod -- is the mod value saved during the integer division in QB64?*).

*I do a lot of microprocessor programming these days and with the compiler I use you don't have to do integer division and mod. Both values are available after just an integer division.
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: 1 Guest(s)