anyone take a shot at this

Apr 19, 2016 25 Replies

Hi,



In a range of n numbers using a set of ?(n)+1 numbers called Y, select the set of numbers Y to maximize the count of pairs of numbers x and y from the set Y where x and y are both prime, and where y is larger than x, and with (y-x) / 2 equal to a number that exists in the set Y.


example1:



n=1 to 10 ?(n)+1 = 5 count of pairs in Y=6 Y=1,2,3,5,7


example2:



n=1 to 100 ?(n)+1=26 count of pairs in Y=99 Y=1,2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97


cheers, Jamie


Oops I gotta restate that (there's no requirement that x and y are both prime doh!)

This should be hopefully correct:

In a range of n numbers using a set of ?(n)+1 numbers called Y, select the set of numbers Y to maximize the count of pairs of numbers x and y from the set Y where x and y both exist in Y, and where y is larger than x, and with (y-x) / 2 equal to a number that exists in the set Y.

cheers, Jamie

On Tue, 19 Apr 2016 14:53:09 -0700, Jamie M Gave us:

Go away,. child

DecadentLinuxUserNumeroUno Wrote in message:

"You took your shot and it did you in! Edison's Medicine! You played your cards but you couldn't win... Edison's Medicine!"

----Android NewsGroup Reader---- http://usenet.sinaapp.com/

I shot an arrow into the air, It fell to earth, I knew not where; For, so swiftly it flew, the sight Could not follow it in its flight.

Longfellow

On Wed, 20 Apr 2016 14:02:35 -0400 (EDT), bitrex Gave us:

You're a retard and the s*it you spew is more stupid than the lies Donald J. Trump spews.

On Wed, 20 Apr 2016 13:13:39 -0500, John S Gave us:

Kind of hard to shoot an arrow into the air from a cave hovel in Belize.

You two could be a bit more retarded, just not in this life.

ct

,97

It appears that sci.math would be a better forum for this.

formatting link

Good luck!

Michael

DecadentLinuxUserNumeroUno Wrote in message:

Grab a beer with me sometime and I GUARANTEE I will help get you laid.

----Android NewsGroup Reader---- http://usenet.sinaapp.com/

On Wed, 20 Apr 2016 18:32:13 -0400 (EDT), bitrex Gave us:

F*ck you. You are not worthy of my beer grabbing company, much less my chick charming prowess.

ct

,97

Of what practical significance is this?

lect

89,97

He'd need it - on present evidence what he actually needs is sci.remedial.m ath

In fact he's explicitly rejected posting anywhere where anybody might be in terested in what he posts - he wants to work it out for himself, which woul d probably need a brain transplant, or at least an implant, granting that n ature seems to have drastically short-changed him in that department.

Bill Sloman, Sydney

Hi,

It is of no practical significance, I'm just trying to learn about math, and writing my step by step work down. With my recent work on jerblets, I was seeing a possible way to make an algorithm to generate the prime numbers and also a new algorithm for the prime counting function, but I am quite certain that I will not be able to do that as I recently noticed that many sequences besides the primes have many more jerblets than the primes do, as when I restricted the search to just even OR odd numbers, there are many examples of both even and odd sequences which have more jerblets than the sequence of primes.

It is possible that there is still a chance for larger sequences the primes can have more jerblets but I am skeptical now.

If the primes had more jerblets, that would mean that there is something special about the configuration of the primes basically, which the jerblet algorithm could describe (doesn't seem to be so now though!)

cheers, Jamie

The question is why you feel the need to show your work in progress here.

This is sci.electronics.design, not remedial.math.homework

Bill Sloman, Sydney

:

select

y

an

3,89,97

.math

interested in what he posts - he wants to work it out for himself, which wo uld probably need a brain transplant, or at least an implant, granting that nature seems to have drastically short-changed him in that department.

Oh, I don't know. His post inspired me to look at the Sieve of Eratosthene s. Quite fun. There's a sample sieve code with the FreeBasic compiler. A fter some modification (it only finds the first million primes) it took my computer just 7.5 seconds to find the first 25 million primes. I'd forgott en how much fun such things could be. Of course, to find these primes, abo ut 2 gigabytes of RAM for array space are needed... I'm sure the algorithm could be refined further by avoiding storage of multiples of two...

Carry on!

Michael

Eratosthenes. Quite fun. There's a sample sieve code with the FreeBasic compiler. After some modification (it only finds the first million primes) it took my computer just 7.5 seconds to find the first

25 million primes. I'd forgotten how much fun such things could be. Of course, to find these primes, about 2 gigabytes of RAM for array space are needed... I'm sure the algorithm could be refined further by avoiding storage of multiples of two...

sounds pretty crap if it runs out of memorty like that. I was able to avoid that problem in 1998 (found 200 million primes used less than 128K memory)

\_(?)_

which would probably need a brain transplant, or at least an implant, granting that nature seems to have drastically short-changed him in that department.

compiler. After some modification (it only finds the first million primes) it took my computer just 7.5 seconds to find the first 25 million primes. I'd forgotten how much fun such things could be. Of course, to find these primes, about 2 gigabytes of RAM for array space are needed... I'm sure the algorithm could be refined further by avoiding storage of multiples of two...

Haha thanks for the encouragement. Glad to hear you are having fun too, thats great, something mysterious about the primes seems to make it fun :)

I want to get back to sieve stuff at some point soon too, seems like the best way to get a handle on the primes.

cheers, Jamie

>

Which algorithm did you use, and how long did it take?

Eratosthenes is supposed to be fast, something like log log N.

I suppose I could use this N^2 algorithm, which only uses a few bytes of me mory for variables :p

for( i=2; i=2; j-- ) if( (i % j) == 0 ) isPrime = 0; if( isPrime == 1 ) printf( "%d ", i ); }

Michael

piecewise seive. basically the same algorithm, but recycling the seive memory.

"all night" on a 486sx 33Mhz running DOS

AFAIK it's the fastest way to find all primes.

formatting link

I think that syntax error is noise (delete that line)

It doesn't run right on 64 bit systems, I think because it makes unwise assumptions on the magnitude if ULONG_MAX.

compiled for 64 bit linux it took about 37 seconds to search to 2^32 on my work PC then failed to stop and eventually died with segv, my laptop is a bit slower. it took 4 minutes.

in 1998 it would have been faster to read 200 million primes from a CD-rom

attached is a slightly updated version, I haven't tested it past 2^32

/*_|_| erastothenes.c _|_|_| A program to find all the primes 1);

for(i=0;i

ng

w */

;

EC);

Wow! Thank you for posting this. I will have to study this further.

Much appreciated!

Michael

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required