Math Is Fun Forum

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

You are not logged in.

#26 2013-04-23 03:53:54

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

Re: My New Twin Prime Numbers

Hi Stangerzv,

For P = 5 I get a different answer from the one in your first post:

Last edited by phrontister (2013-04-23 05:20:32)


"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

#27 2013-04-23 04:16:34

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

Re: My New Twin Prime Numbers

Hi,

For P=19

Last edited by phrontister (2013-04-23 11:16:23)


"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

#28 2013-04-23 04:33:46

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

Re: My New Twin Prime Numbers

Hi,

For P=13

Last edited by phrontister (2013-04-23 11:16:05)


"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

#29 2013-04-23 04:42:36

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

Re: My New Twin Prime Numbers

A couple more (hope I'm doing this right)!

For P=23


For P=29

Last edited by phrontister (2013-04-23 11:15:48)


"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

#30 2013-04-23 05:18:21

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

Re: My New Twin Prime Numbers

Hi Stangerzv;

For P = 2, 2^2 ± 1 = {3,5} which is smaller.

For P = 5, phrontister is correct. The solution in post #1 is incorrect.

are not both prime.

Hi phrontister;

Very good work!


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

#31 2013-04-23 05:44:14

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

Re: My New Twin Prime Numbers

Hi Bobby,

Thank you. smile

Yes, my original program found that small answer for P=2, but later when I saw the larger answer in Stranerzv's first post and reread the post I thought (correctly or incorrectly) that "consecutive primes" meant there should be multiple primes in the answer...and so I changed my program to what it is now.

I don't really understand that sigma notation very well (even though stefy told me how it worked) and so I couldn't tell from the one in post #1 whether or not I made the right decision. I copied the sigma thingy from your post and used it for mine.


"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

#32 2013-04-23 05:46:07

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

Re: My New Twin Prime Numbers

Hi;

It is just a shorthand for summation.

For P = 31


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

#33 2013-04-23 05:49:21

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

Re: My New Twin Prime Numbers

Thanks...I remember now. But can you tell from that if the answer should contain multiple primes?


"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

#34 2013-04-23 05:57:04

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

Re: My New Twin Prime Numbers

I'm off to bed now...but I've set the program to test a larger number that might take it a while.


"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

#35 2013-04-23 06:00:47

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

Re: My New Twin Prime Numbers

But can you tell from that if the answer should contain multiple primes?

I am not following you, can you explain?


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

#36 2013-04-23 10:54:00

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

Re: My New Twin Prime Numbers

For the short version of P=2 there's only one Pi, which means the answer doesn't contain the "consecutive primes" mentioned in post #1. But I'm pretty sure that I've misunderstood the intent and that a single Pi is fine...which means I should change my code back to what it was originally.


"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

#37 2013-04-23 10:57:10

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

Re: My New Twin Prime Numbers

I thought the pair meant the plus minus of n.


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

#38 2013-04-23 11:00:18

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

Re: My New Twin Prime Numbers

Here's my answer for the lowest 3-digit Prime-th Power.

For P=101

Last edited by phrontister (2013-04-23 11:15:01)


"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

#39 2013-04-23 11:05:27

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

Re: My New Twin Prime Numbers

Hi Bobby,

I thought the pair meant the plus minus of n.

I was referring to this, from post #1:

Where all Pi are the consecutive primes

I'd still think that a single Pi is valid, though, even though it isn't a 'consecutive' series.


"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

#40 2013-04-23 11:23:11

Stangerzv
Member
Registered: 2012-01-30
Posts: 266

Re: My New Twin Prime Numbers

Hi phrontister

Thanks for the solutions, 2^2+-1=3,5 it is part of the solutions, in which I overlooked it, it seems the equation can generate larger primes and it is becoming more interesting.

bobbym, I am drafting a research grant for my prime equations, that is why I put on hold for the grid computing. It would be kool to have a facility that could run very big calculations at a faster rate. I have more prime equations, I am trying to get a research grant to study them and maybe trying to find the largest primes as alternative to Mersenne in the future. This is one of the prime equations that could give big Prime at a smaller prime number input, the derivation of the equation is simple.

(10002^214+10003^214)/(10002^2+10003^2)=849 Digits Prime and (10002^562+10003^562)/(10002^2+10003^2)=2241 Digits Prime.

Last edited by Stangerzv (2013-04-23 11:24:42)

Offline

#41 2013-04-23 11:40:28

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

Re: My New Twin Prime Numbers

Hi;

Good luck with the grant.
As far as this problem is concerned I think there will always be a solution it is just a matter of going far enough.


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

#42 2013-04-23 23:09:16

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

Re: My New Twin Prime Numbers

Hi Bobby,

Here is my M code. Got any suggestions to improve it? It finds P=13 in just under 7 seconds.

Is yours much different? Mine is very raw, just looking for the answer without any fancy output formatting.

I enjoyed writing the code, and learnt some new things (eg, 'Break', 'PrimeQ', 'NextPrime', the table of primes, and better understanding of 'If').

Last edited by phrontister (2013-04-23 23:20:30)


"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

#43 2013-04-24 02:24:34

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

Re: My New Twin Prime Numbers

Hi;


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

#44 2013-04-24 12:56:12

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

Re: My New Twin Prime Numbers

Thanks for that, Bobby...but I don't understand it. I suppose that yours is a functional approach, and my procedural brain can't grasp that yet. My code's just LB under the M hood.

I'm trying to use the help files to work out what it all means, but it's slow going.

What does the answer 2763 represent? Also, entering higher upper limits give further answers after the initial 2763, but I don't know what they mean either...or even if they're supposed to be there.

Or maybe I should wait for your final version before going further with this.

Last edited by phrontister (2013-04-24 13:17:43)


"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

#45 2013-04-24 16:00:32

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

Re: My New Twin Prime Numbers

Hi phrontister;

The 2763 is the first answer for P = 7. Other numbers just mean there are more than one answer further down.


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

#46 2013-04-24 16:24:11

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

Re: My New Twin Prime Numbers

Hi Bobby,

Yes...I worked that out soon after I asked.

Your code is excellent for finding multiple solutions!

When I tried P=13 the quickest time with your code was about 11 seconds, compared to about 7 seconds with mine. I don't know how to tweak yours to make it faster.

I suppose the main flaw is having to guess the upper limits, and the more accurate your guess the closer you are to the minimum processing time. 'Break' stopped my procedural program when the answer was found, but I don't know how to exit early with your code.

I played around with your code for printing the results:

Last edited by phrontister (2013-04-24 16:29:07)


"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

#47 2013-04-24 16:30:20

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

Re: My New Twin Prime Numbers

Hi;

Yes, getting it to stop is something I am working on. Unfortunately connection problems have kept me on the
phone all day and I got nothing done.


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

#48 2013-04-24 16:55:51

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

Re: My New Twin Prime Numbers

Btw, the code in my previous post only works for t>=f, otherwise it prints an error (c.f. your original code, which just prints a blank if the upper limit is too low).

Edit: I just got an error message (not just a blank) with your original code for P=101, so what I said in the para above isn't quite right.

Last edited by phrontister (2013-04-24 17:07:10)


"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

#49 2013-04-24 17:03:33

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

Re: My New Twin Prime Numbers

Also, I used t for the two upper limits as I couldn't see any reason for them to differ. That cuts the time down a bit.


"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

#50 2013-04-24 17:03:44

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

Re: My New Twin Prime Numbers

Hi;

I am working on an idea to improve it but the problems with the connection just won't stop.


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

Board footer

Powered by FluxBB