Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ π -¹ ² ³ °

You are not logged in.

- Topics: Active | Unanswered

Ya because at last we can check whether it has the required number of primes or not. And moreover, the number of primes can be less but NEVER more because if it says that a number is composite it definately is

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'Humanity is still kept intact. It remains within.' -Alokananda

**Online**

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 83,159

Okay, so we have sped it up already because you are no longer using trial division, which is slow.

Let's talk about the list itself. 455 million primes is a very, very big list. There is no list like that on the internet and for good reason. It is going to be a gigabyte or more.

**In mathematics, you don't understand things. You just get used to them.I have the result, but I do not yet know how to get it.All physicists, and a good many quite respectable mathematicians are contemptuous about proof.**

Offline

Okay! A gigabite?

That's quite huge

*Last edited by Agnishom (2013-04-09 08:05:04)*

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'Humanity is still kept intact. It remains within.' -Alokananda

**Online**

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 83,159

Each prime you will probably store in ascii. An n digit number takes at least n bytes of storage on your drive.

Do you keep the file open and then write all the primes and then close it?

**In mathematics, you don't understand things. You just get used to them.I have the result, but I do not yet know how to get it.All physicists, and a good many quite respectable mathematicians are contemptuous about proof.**

Offline

Yes, actually closing it isn't a part of the code

*Last edited by Agnishom (2013-04-09 08:08:24)*

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'Humanity is still kept intact. It remains within.' -Alokananda

**Online**

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 83,159

So there is one opening of the file and one closing?

**In mathematics, you don't understand things. You just get used to them.I have the result, but I do not yet know how to get it.All physicists, and a good many quite respectable mathematicians are contemptuous about proof.**

Offline

Yes, so what?

I was talking with 65 and I'm already too late to sleep today.

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'Humanity is still kept intact. It remains within.' -Alokananda

**Online**

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 83,159

Okay, that is alright then. If you opened and closed it after writing each number n, it would be much slower.

Now you say that it took all night to generate 1 million primes.

I have the result, but I do not yet know how to get it.

All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

LOL, good night

Its 10 million

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'Humanity is still kept intact. It remains within.' -Alokananda

**Online**

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 83,159

When you come back tell me how long the program took without writing to the file.

I have the result, but I do not yet know how to get it.

All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

I am back but I didn't understand what you asked

*Last edited by Agnishom (2013-04-09 16:06:53)*

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'Humanity is still kept intact. It remains within.' -Alokananda

**Online**

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 83,159

If you took out the writing to the file and just generated the 10 million how long would that take?

It could be that writing to a file is what is taking all the time. If you think 10 million is still too much then tell me how long it takes for 1 million without the file operations.

I have the result, but I do not yet know how to get it.

All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

Then where will the generated primes go?

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'Humanity is still kept intact. It remains within.' -Alokananda

**Online**

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 83,159

Nowhere, you are just benchmarking the program to see which part of the routine is using the most time.

I have the result, but I do not yet know how to get it.

All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

i have forgotten to mention something else which is slowing me down

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'Humanity is still kept intact. It remains within.' -Alokananda

**Online**

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 83,159

Please mention it?!

I have the result, but I do not yet know how to get it.

All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

I told it to display n to the console whenever it is a multiple of 1000, so as to know the progress

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'Humanity is still kept intact. It remains within.' -Alokananda

**Online**

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 83,159

Where are you now?

I have the result, but I do not yet know how to get it.

All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

I terminated the program, I have no more interest -a 17 mb file is enough to split all 10 digit phone numbers.

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'Humanity is still kept intact. It remains within.' -Alokananda

**Online**

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 83,159

Okay, then the problem is solved. You are satisfied so I am too.

I have the result, but I do not yet know how to get it.

All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

Actually I am pretty much afraid of 1 gb file size

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'Humanity is still kept intact. It remains within.' -Alokananda

**Online**

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 83,159

You should be! You have had your first taste of computational number theory and saw the big problem.

I have the result, but I do not yet know how to get it.

All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

What does computational number theory consist of?

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'Humanity is still kept intact. It remains within.' -Alokananda

**Online**

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 83,159

You just did it.

I have the result, but I do not yet know how to get it.

All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

Hmm

I am surprised no one is happy to see that their phone number as a sum of two primes. Not even my dad.

My brother seems a 'little' happy though

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'Humanity is still kept intact. It remains within.' -Alokananda

**Online**