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

You are not logged in.

- Topics: Active | Unanswered

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,609

Good luck with that! I have to go out now...

"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

Hi;

Sorry, but problems still not fixed and it looks like my connectivity will be on and off for the rest of the night.

See you later.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,609

Hi Bobby,

Just messin' 'round with output presentation, and also included a timer, infinite looping (for looooong calcs) and a prompt for P. Here's what I've done:

*Last edited by phrontister (2013-04-28 00:51:25)*

"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

Hi;

Your machine is faster than mine. Mine took 12 seconds.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,609

I grease the workings of my computer with Vegemite. If you want to try that on your machine to soup it up, just make sure you don't use molasses, which has a similar appearance but will have the opposite effect.

*Last edited by phrontister (2013-04-25 00:04:35)*

"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

Hi phrontister;

I will try that but vegemite is hard to come by here.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,609

Hi Bobby,

You probably already know approx how the running times of the various parts of your code compare, but I thought I'd run a 'Timing' test so I could see which area/s could do with some speeding up. I used P=13 and minimum upper limits.

0.047 seconds: p = Table[Prime[k], {k, 1, 45793}];

0.109 seconds: ans = Accumulate[Table[p[[n]]^13, {n, 1, 45793}]];

10.656 seconds: Position[MapIndexed[fubar, ans], {{True}, {True}}]

I'm not sure how to break that last one into separate times for Position and MapIndexed, but from a test I tried it seems that MapIndexed takes up most of the combined time (but I may be wrong there, because I had to split that line into two for Timing to work).

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

Hi;

That is to be expected, that is where the primality testing is. But it does look like I did not choose the best way possible.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,609

Getting sleepy...my inbuilt clock is running down. CuL8r.

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

Hi;

Okay, have a good night. Maybe I will have something to post when you get back.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,609

Hi Bobby,

I just changed my code in post #53 to remove the upper limit, which will be useful for cooking my cpu during long service leave if I particularly want to solve a hard-to-get P value.

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

Hi;

There is some strange coincidence with these answers.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,609

What have you discovered?

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

That all the n's are odd.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,609

That is an 'odd' coincidence!

Actually, I don't know how to check that. I tried printing n, but failed.

And I have to go out now...

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

Okay, there are even answers but the first answer is so far always odd. Have a good time.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**Stangerzv****Member**- Registered: 2012-01-30
- Posts: 256

hi bobbym

Yeah I notice it too..can you get n to be even for Ps? It is like finding odd perfect numbers, so far all perfect numbers are even.

*Last edited by Stangerzv (2013-04-25 15:22:52)*

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

Hi;

This is an even answer for n, but it is not the smallest one.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,609

I changed my code to run automatically while I was out, and got the following:

All odd from P=2 to P=43.

Then 3 evens:

P=47: n=43620

P=53: n=10102

P=59: n=181138

P=61 is back to odd again, and then 3 evens:

P=67 n=25982

P=71: n=64636

P=73: n=342

There may not be an odd:even pattern.

P=79 is computing now, but is taking a long time.

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,609

Oops...for P=37, n=57126

...and P=79: n=621475

*Last edited by phrontister (2013-04-25 18:36:38)*

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

Was that P = 37 the smallest one?

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,609

Yes. I tested it in your program and in mine.

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

Okay, then that puts that conjecture to sleep.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**Stangerzv****Member**- Registered: 2012-01-30
- Posts: 256

If there is no computer maybe it would take hundreds of years to verify this for sure. But now it takes less than a day:)

Offline

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

Hi Stangerzv;

I doubt that anyone would ever be attempting this without a computer.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline