mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   PARI/GP (https://www.mersenneforum.org/forumdisplay.php?f=155)
-   -   PARI's commands (https://www.mersenneforum.org/showthread.php?t=13636)

3.14159 2010-08-29 17:36

Item 16 is also the hardest to find, when dealing with larger numbers. Coincidentally, it is also the only item that is both a square and fourth power.

3.14159 2010-08-29 17:41

Wow. It is barren from 1 to 80k for multiplier 120!

3.14159 2010-08-29 17:43

Wait.. Prime fermat numbers are probably finite for any given base. So there are no examples for 120!. That explains it.

For item 16: There are probably [B]no 1000+ digit examples.[/B]

Due to that, this is the only category that will be restricted to small primes, 100-750 digits.

If you find me a 1000+ digit example, the restriction will be lifted.

CRGreathouse 2010-08-29 17:47

[QUOTE=3.14159;227515]I normally choose the multiplier and k-range.[/QUOTE]

Can you give an example for how you'd do that for #16?

CRGreathouse 2010-08-29 17:48

[QUOTE=3.14159;227516]Item 16 is also the hardest to find, when dealing with larger numbers. Coincidentally, it is also the only item that is both a square and fourth power.[/QUOTE]

Yeah, those fourth powers sure have a lot of nonsquares. :lol:

3.14159 2010-08-29 17:50

[QUOTE=CRGreathouse]Can you give an example for how you'd do that for #16?
[/QUOTE]

Sure. Suppose your multiplier is 11

So (k * 11)[sup](1, 2, and 4)[/sup] + 1 are all primes.

An example is (from PARI): 107251 and 11502562501 and 132308944066406250001 are primes

3.14159 2010-08-29 17:52

[QUOTE=CRGreathouse]Yeah, those fourth powers sure have a lot of nonsquares.
[/QUOTE]

A number can be a square and not a fourth power.

Ex: 16129 = 127[sup]2[/sup].

Is 16129 a fourth power?

science_man_88 2010-08-29 17:57

[QUOTE=CRGreathouse;227521]Yeah, those fourth powers sure have a lot of nonsquares. :lol:[/QUOTE]

what he's pointing Pi out is you say both a square and a fourth power but x^4 = x^2^2 so it's a square hence the fourth power part is pointless in one sense if I read it correctly.

3.14159 2010-08-29 17:59

[QUOTE=CRGreathouse]what he's pointing out is you say both a square and a fourth power but x^4 = x^2^2 so it's a square hence the fourth power part is pointless in one sense if I read it correctly.
[/QUOTE]

Hence, my rebut still stands.

If it were item 25, I would only claim it is a square number.

CRGreathouse 2010-08-29 18:01

[QUOTE=science_man_88;227524]what he's pointing Pi out is you say both a square and a fourth power but x^4 = x^2^2 so it's a square hence the fourth power part is pointless in one sense if I read it correctly.[/QUOTE]

Well, the reverse rather: if you say fourth power, it's automatically a square so it's redundant to claim a number as both a square and a fourth power.

3.14159 2010-08-29 18:03

[QUOTE=CRGreathouse]Well, the reverse rather: if you say fourth power, it's automatically a square so it's redundant to claim a number as both a square and a fourth power.
[/QUOTE]

The set of squares that are also 4th powers are not all the squares. That clear enough for you?

CRGreathouse 2010-08-29 18:13

[QUOTE=3.14159;227527]The set of squares that are also 4th powers are not all the squares. That clear enough for you?[/QUOTE]

The set of fourth powers that are also squares are all the fourth powers. That clear enough for you?

3.14159 2010-08-29 18:27

[QUOTE=CRGreathouse]The set of fourth powers that are also squares are all the fourth powers. That clear enough for you?
[/QUOTE]

Invalid, because I did not post "Fourth power and square", I posted "Square and fourth power", meaning that the coincidence was that it was a square that was also in the set of fourth powers.

Or do you have a marked inability to read?

CRGreathouse 2010-08-29 18:41

[QUOTE=3.14159;227531]Invalid, because I did not post "Fourth power and square", I posted "Square and fourth power", meaning that the coincidence was that it was a square that was also in the set of fourth powers.

Or do you have a marked inability to read?[/QUOTE]

Wait, are you seriously defending "square and fourth power" as non-redundant? :huh:

:missingteeth:

science_man_88 2010-08-29 18:42

[QUOTE=3.14159;227531]Invalid, because I did not post "Fourth power and square", I posted "Square and fourth power", meaning that the coincidence was that it was a square that was also in the set of fourth powers.

Or do you have a marked inability to read?[/QUOTE]
are you saying n= x^2 = y^4 ? because the way I understand it that's not what's needed.

what's needed to be tested are numbers n such that n =4 or 0 mod 6 such that n^2 = 4 or 0 mod 6 such that n^4 is 0 or 4 mod 6 so that they align with 1 or 5 mod 6 for the respective equations.

3.14159 2010-08-29 18:47

[QUOTE=CRGreathouse]Wait, are you seriously defending "square and fourth power" as non-redundant? :huh: + :missingteeth:
[/QUOTE]

[QUOTE=3.14159][B]Coincidentally, it is also the only item that is both a square and fourth power.[/B][/QUOTE]

Get it?

Coincidentally, it is in the set of square numbers [B]and[/B] the set of fourth powers?

Where is the redundancy?

A number is in the set of square numbers and the set of fourth powers.

If it were redundant, that condition would apply to all square numbers. But it does not.

CRGreathouse 2010-08-29 18:49

[QUOTE=3.14159;227534]Coincidentally, it is in the set of square numbers [B]and[/B] the set of fourth powers?[/QUOTE]

Yeah, sorry... not a coincidence.

science_man_88 2010-08-29 18:49

[QUOTE=3.14159;227534]Get it?

Coincidentally, it is in the set of square numbers [B]and[/B] the set of fourth powers?[/QUOTE]

that's every fourth power turned into a square but if n must not change then that's not what you wanted.

3.14159 2010-08-29 18:52

[QUOTE=CRGreathouse]Yeah, sorry... not a coincidence.
[/QUOTE]

In reference to Item 16.

You have failed to tell where the redundancy is in the statement, "A number x is in the set of squares and the set of fourth powers."

CRGreathouse 2010-08-29 18:57

[QUOTE=3.14159;227537]In reference to Item 16.

You have failed to tell where the redundancy is in the statement, "A number x is in the set of squares and the set of fourth powers."[/QUOTE]

Really? Do I need to hold your hand?

A number x is in the [COLOR="Red"]set of squares[/COLOR] and the [COLOR="DarkGreen"]set of fourth powers[/COLOR].

is the same as

A number x is in the the [COLOR="DarkGreen"]set of fourth powers[/COLOR].

Thus the red portion and the green portion are redundant.


Non-mathematical example of redundancy (that I just came across):
"[COLOR="Red"]short[/COLOR] and [COLOR="DarkGreen"]concise[/COLOR]"

is the same as

"[COLOR="DarkGreen"]concise[/COLOR]"

thus the red portion is redundant.

science_man_88 2010-08-29 19:09

what you want to calculate is:

[url]http://www.research.att.com/~njas/sequences/A070325[/url]

what you are implying is the item must be in:

[url]http://www.research.att.com/~njas/sequences/A000290[/url]

and

[url]http://www.research.att.com/~njas/sequences/A000583[/url]

what you must realize is:

A000583 is a subset of the other so the item being in this is the same as it being in both. hence you statement is redundant (and in my eyes untrue).

science_man_88 2010-08-29 19:15

forgot my Pari code to help you Pi:

[CODE]for(n=1,2000,if(isprime(n+1) && isprime(n^2+1) && isprime(n^4+1),print(n)))[/CODE]

CRGreathouse 2010-08-29 19:17

[QUOTE=science_man_88;227540]what you want to calculate is:

[url]http://www.research.att.com/~njas/sequences/A070325[/url][/QUOTE]

Good catch. Related: [url]http://oeis.org/classic/A127435[/url]

science_man_88 2010-08-29 19:22

[CODE]for(n=1, 33000, if(isprime(n^2+1)*isprime(n^4+1)*isprime(n+1)==1, print1(n, ", ")))[/CODE]

that's the code that's up on [url]http://www.research.att.com/~njas/sequences/A070325[/url] but why multiply you still have to calculate isprime() to check it, is it faster than && ?

3.14159 2010-08-29 19:27

[QUOTE=CRGreathouse]A number x is in the set of squares and the set of fourth powers.

is the same as

A number x is in the the set of fourth powers.[/QUOTE]

This one falls apart really quickly.

This would only be true if the set of squares were all fourth powers as well.

25 is a square number and is not a 4th power.
625 is a square number and is a fourth power.

49 is a square number that is not in the set of fourth powers.
2401 is a square number that is in the set of fourth powers.

CRGreathouse 2010-08-29 19:29

Back on topic:
[QUOTE=3.14159;227519]Wait.. Prime fermat numbers are probably finite for any given base. So there are no examples for 120!. That explains it.

For item 16: There are probably [B]no 1000+ digit examples.[/B]

Due to that, this is the only category that will be restricted to small primes, 100-750 digits.

If you find me a 1000+ digit example, the restriction will be lifted.[/QUOTE]

With n = 3 · 2[SUP]410857[/SUP], n + 1, n[SUP]2[/SUP] + 1, and n[SUP]4[/SUP] + 1 are primes. Since 494724 ≥ 1000, I trust you'll be lifting the restriction?

3.14159 2010-08-29 19:31

[QUOTE=CRGreathouse]With n = 3 · 2[sup]410857[/sup], n + 1, n[sup]2[/sup] + 1, and n[sup]4[/sup] + 1 are primes. Since 494724 ≥ 1000, I trust you'll be lifting the restriction?
[/QUOTE]

Restriction lifted.

science_man_88 2010-08-29 19:31

[QUOTE=CRGreathouse;227542]Good catch. Related: [url]http://oeis.org/classic/A127435[/url][/QUOTE]

I could see if it was faster but according to a few test of each mine is about 40 times faster and I think I know why based on my knowledge of what the comparison in ASM might be like.

mine uses 2 cmp operations

the one shown uses 1 cmp and 3 mult() ? operations (not sure if this makes the difference though) as i don't know how much slower / faster multiplication is comparing it to a cmp() operation.

CRGreathouse 2010-08-29 19:32

[QUOTE=3.14159;227545][QUOTE=CRGreathouse;227539]A number x is in the [COLOR="Red"]set of squares[/COLOR] and the [COLOR="DarkGreen"]set of fourth powers[/COLOR].

is the same as

A number x is in the the [COLOR="DarkGreen"]set of fourth powers[/COLOR].[/QUOTE]

This one falls apart really quickly.[/QUOTE]

Really? Please provide an example of a member of the set of fourth powers that is not a member of the set of squares and the set of fourth powers, or a member of the set of squares and the set of fourth powers, but not a member of the set of fourth powers.

CRGreathouse 2010-08-29 19:35

[QUOTE=science_man_88;227549]I could see if it was faster[/QUOTE]

What is "it"?

[QUOTE=science_man_88;227549]mine uses 2 cmp operations

the one shown uses 1 cmp and 3 mult() ? operations (not sure if this makes the difference though) as i don't know how much slower / faster multiplication is comparing it to a cmp() operation.[/QUOTE]

imul takes about 4 times as long as cmp. fmul is similar. For older CPUs, cmp was relatively better.

3.14159 2010-08-29 19:37

[QUOTE=CRGreathouse]Really? Please provide an example of a member of the set of fourth powers that is not a member of the set of squares and the set of fourth powers, or a member of the set of squares and the set of fourth powers, but not a member of the set of fourth powers.
[/QUOTE]

There is no such example, but there is no redundancy.

Here's another example:

169 is a square number, and it is not a fourth power.
28561 is a square number, and it is also a fourth power.

Or:

169 is in set x but is not in set y.
28561 is in set x and is in set y.

All members of set y are in set x.
Not all members of set x are in set y.

science_man_88 2010-08-29 19:39

[QUOTE=CRGreathouse;227551]What is "it"?



imul takes about 4 times as long as cmp. fmul is similar. For older CPUs, cmp was relatively better.[/QUOTE]

that's why mine gave me times of 10-20 ms but the other gave me 600-650? ms

thanks I think if we want fast code in the OEIS the code shown should be changed for it= [url]http://www.research.att.com/~njas/sequences/A070325[/url]

CRGreathouse 2010-08-29 19:40

[QUOTE=3.14159;227553]There is no such example, but there is no redundancy.

Here's another example:

169 is a square number, and it is not a fourth power.
28561 is a square number, and it is also a fourth power.

Or:

169 is in set x but is not in set y.
28561 is in set x and is in set y.

No redundancies.[/QUOTE]

Ah, so you just don't understand the word "redundancy".

kar_bon 2010-08-29 19:41

The expression "if ((a==true) * (b==true) * (c==true) == 1)" depends also on the interpreter/compiler.

If the first expression is false (a=false), the whole expression won't be true anymore (if true treated as '1' and false as '0')!

So the other two comparisons (b and c) could be omitted and that would be really faster!

CRGreathouse 2010-08-29 19:44

Edit: kar_bon explains this above, see post #1101.

[QUOTE=science_man_88;227554]that's why mine gave me times of 10-20 ms but the other gave me 600-650? ms[/QUOTE]

Ah, I see what you're saying. No, not really -- the savings is the fact that you don't calculate isprime() more than needed. cmp isn't what's at issue here -- actually, your method introduces an expensive branch operation (JZ, probably). But much better to have a JZ and risk throwing out your pipeline than calculate another isprime(), which will take thousands of cycles in the best case.

But if you want fast code you can do better. Try
[code]forprime(p=2,1e9,n=p-1;if(isprime(n^2+1)&isprime(n^4+1),print1(n",")))[/code]
for example.

3.14159 2010-08-29 19:47

[QUOTE=CRGreathouse]Ah, so you just don't understand the word "redundancy".
[/QUOTE]

There are no redundancies.

Not every square number is a fourth power. Fourth powers are a subset of squares.

Nevermind. This is getting me nowhere. Fine, you win. You can keep the smug expression on your face.

science_man_88 2010-08-29 19:47

the code is for pari and no regardless of if the first is one this code uses imul() 2 times and a cmp so about 9 cmp equivalent regardless mine uses 3 cmp and 2 and commands equivalent so unless each and is triggered every time and takes 3 cmp each my code is faster karsten.

science_man_88 2010-08-29 19:50

[QUOTE=CRGreathouse;227557]

But if you want fast code you can do better. Try
[code]forprime(p=2,1e9,n=p-1;if(isprime(n^2+1)&isprime(n^4+1),print1(n",")))[/code][/QUOTE]

this only does better under primelimit if it goes over it throws an error mine can go to at least primelimit^2 but I could check if I can speed mine up more lol. also this is about same timing as mine for one test and unless there's a law if n^2+1 is prime and n^4+1 is prime then n+1 is prime this isn't what solves it and you use & not && why ?

CRGreathouse 2010-08-29 19:52

[QUOTE=3.14159;227558]There are no redundancies.

Not every square number is a fourth power. Fourth powers are a subset of squares.[/QUOTE]

It is *because* fourth powers are a subset of squares that the expression is redundant. You're arguing that it's not redundant because it's not the same as "x is a square", but since it *is* the same as "x is a fourth power" the expression is redundant.

[QUOTE=3.14159;227558]Nevermind. This is getting me nowhere. Fine, you win. You can keep the smug expression on your face.[/QUOTE]

Nah, I really only look smug when I'm showing a trivial (counter)example.

CRGreathouse 2010-08-29 19:57

[QUOTE=science_man_88;227559]the code is for pari and no regardless of if the first is one this code uses imul() 2 times and a cmp so about 9 cmp equivalent regardless mine uses 3 cmp and 2 and commands equivalent so unless each and is triggered every time and takes 3 cmp each my code is faster karsten.[/QUOTE]

Don't be too quick to translate Pari code to assembly. There's quite a bit of overhead associated with using multiprecision numbers and dynamic typing.

But in this case that's not really the point -- the point is that your code is better than the one given in the sequence because it does less work (not checking the larger numbers for primality if the smaller ones fail), *not* because of the cmp vs. imul. That difference would be too small to measure with that few iterations.

CRGreathouse 2010-08-29 20:00

[QUOTE=science_man_88;227560]this only does better under primelimit if it goes over it throws an error mine can go to at least primelimit^2 but I could check if I can speed mine up more lol.[/QUOTE]

You're better off increasing primelimit in that case. I just sent in a b-file with the first 10,000 terms; it took 12.2 seconds + 3.8 seconds for increasing primelimit. Your code (appropriately modified to store the results in an array the same way I did with mine) took 35.4 seconds.

Edit: I could have reduced the time needed for the primelimit calculation to 90 ms by reducing the bound to 31370407...

[QUOTE=science_man_88;227560]you use & not && why ?[/QUOTE]

They're exactly the same in Pari; I occasionally use one and occasionally the other.

[QUOTE=science_man_88;227560]also this is about same timing as mine for one test and unless there's a law if n^2+1 is prime and n^4+1 is prime then n+1 is prime this isn't what solves it[/QUOTE]

I'm betting that if you look at my code more closely you'll be able to figure this one out.

kar_bon 2010-08-29 20:03

[QUOTE=CRGreathouse;227563]I'm betting that if you look at my code more closely you'll be able to figure this one out.[/QUOTE]

"forprime(p=2,1e9,n=p-1 (...)" is the relevant part! Good job!

science_man_88 2010-08-29 20:14

[QUOTE=kar_bon;227564]"forprime(p=2,1e9,n=p-1 (...)" is the relevant part! Good job![/QUOTE]

so in other words it only works when n is 1 less than a prime ?

CRGreathouse 2010-08-29 20:17

[QUOTE=science_man_88;227566]so in other words it only works when n is 1 less than a prime ?[/QUOTE]

Instead of testing if n+1 is a prime, I loop through the primes, choosing n = p-1 so that n+1 is prime. Because I'm using Pari's precalculated list instead of testing numbers, the search is much faster. (This occurs even if I have to generate the whole list myself -- sieving is much faster than testing.)

science_man_88 2010-08-29 20:25

[QUOTE=CRGreathouse;227567]Instead of testing if n+1 is a prime, I loop through the primes, choosing n = p-1 so that n+1 is prime. Because I'm using Pari's precalculated list instead of testing numbers, the search is much faster. (This occurs even if I have to generate the whole list myself -- sieving is much faster than testing.)[/QUOTE]

my brain must have been switched off before lol.

3.14159 2010-08-29 20:37

[QUOTE=CRGreathouse]Instead of testing if n+1 is a prime, I loop through the primes, choosing n = p-1 so that n+1 is prime. Because I'm using Pari's precalculated list instead of testing numbers, the search is much faster. (This occurs even if I have to generate the whole list myself -- sieving is much faster than testing.)[/QUOTE]

This renders you unable to test for larger numbers.

CRGreathouse 2010-08-29 20:37

[QUOTE=science_man_88;227569]outside of the fact that if you want them in order it's unlikely with my alteration wouldn't it be faster to say [CODE]n=p-1;a^2=p-1;b^4=p-1[/CODE] to check 3 at once ? though this would take 3 times the memory I think.[/QUOTE]

That wouldn't work. First, you can't assign to a^2 (in C terminology, it's an rvalue not an lvalue; in assembly terms (though not strictly relevant here!), it's not memory-mapped). Second, you can't fix more than one member -- once you pick one, you fix the values for all of them.

kar_bon 2010-08-29 20:38

[QUOTE=CRGreathouse;227571]That wouldn't work.[/QUOTE]

Yep, he's discovered! ... and deleted!

3.14159 2010-08-29 20:41

[code]1546750398064958524633425292455441988676752527730835687139862311217981986247572619886186890734016949799686352443760408934653066300968034776190705901570570913201114184380563243205276690363368824249952639567750758594330067937015662345505149388718977581056000000000000000000000000000000000000000000000001[/code]

76, 151, 301 digits, new record for Number, square, and fourth.

CRGreathouse 2010-08-29 20:44

[QUOTE=3.14159;227570]This renders you unable to test for larger numbers.[/QUOTE]

As long as you're working below 4e9 or 1e10 or so (depending on your platform), it's *far* more efficient to use forprime.

Further, for any number for which it is viable to generate all members up to, it's most efficient to sieve in some form. You could be talking about running overnight vs. taking a week. Of course this would take custom code!

I happen to have this: prototype code that lets me loop over primes up to primelimit^2 rather than primelimit. I'm not going to release it at this time: it's buggy near the endpoints and I need to fix that, plus it requires a dynamic installation of Pari so doesn't work for people who only have the Windows binary.

3.14159 2010-08-29 22:01

[QUOTE=CRGreathouse]Further, for any number for which it is viable to generate all members up to, it's most efficient to sieve in some form. You could be talking about running overnight vs. taking a week. Of course this would take custom code!
[/QUOTE]

Or a download of an already existing implementation of the sieve.

3.14159 2010-08-29 22:14

Well, one may already exist in form of a sieve for Generalized Fermat numbers. All that is required is sieving for n^2 + 1 and n^4 + 1

CRGreathouse 2010-08-29 22:15

[QUOTE=3.14159;227576]Or a download of an already existing implementation of the sieve.[/QUOTE]

Do you know of any good out-of-memory sieves?

3.14159 2010-08-29 22:27

[QUOTE=CRGreathouse]Do you know of any good out-of-memory sieves?
[/QUOTE]

Well, I have a program that sieves for Generalized Fermats. You could sieve for n^2 + 1 and n^4 + 1 and take whatever elements both files have in common.

CRGreathouse 2010-08-29 22:35

[QUOTE=3.14159;227579]Well, I have a program that sieves for Generalized Fermats. You could sieve for n^2 + 1 and n^4 + 1 and take whatever elements both files have in common.[/QUOTE]

In a pinch, I suppose that works. You just test the remainder for primality of n+1, I suppose?

3.14159 2010-08-29 22:47

[QUOTE=CRGreathouse]In a pinch, I suppose that works. You just test the remainder for primality of n+1, I suppose?
[/QUOTE]

I suppose that might work.

science_man_88 2010-08-29 22:53

back to post 885 around this post I wanted to know when 2^recurrence just like the recurrence of the Mersenne numbers-1 for a specific start number etc. I find 11 a start number that seemed to work up to the known height of Mersenne exponents. wonder if anyone can tell me the odds.

CRGreathouse 2010-08-29 22:55

See [url]http://primes.utm.edu/notes/faq/NextMersenne.html[/url]

science_man_88 2010-08-29 23:14

[QUOTE=CRGreathouse;227585]See [url]http://primes.utm.edu/notes/faq/NextMersenne.html[/url][/QUOTE]

not quite what I meant CRG. what I mean't was the sequence 11,23,47,95,......

which has the same recurrence as the Mersenne numbers at an exception in the exponents seems to never come across a prime exponent that works to be a Mersenne prime exponent. I had a code to try this out when you asked for a sequence but I'll have to figure it out again lol.

CRGreathouse 2010-08-29 23:47

[QUOTE=science_man_88;227588]not quite what I meant CRG. what I mean't was the sequence 11,23,47,95,......

which has the same recurrence as the Mersenne numbers at an exception in the exponents seems to never come across a prime exponent that works to be a Mersenne prime exponent. I had a code to try this out when you asked for a sequence but I'll have to figure it out again lol.[/QUOTE]

You're going to need to learn to be more explicit. I still don't know what you mean because you're [i]actually not telling me[/i].

3.14159 2010-08-29 23:49

[QUOTE=CRGreathouse]You're going to need to learn to be more explicit. I still don't know what you mean because you're actually not telling me.
[/QUOTE]

By the way: Have you discovered any primes of any significant size, for items 1-19?

science_man_88 2010-08-29 23:52

[CODE]for(s=1,50,for(x=s,20000000*s,print1(x",");x=x*2);print(""))[/CODE]

this should help your memory CRG.

3.14159 2010-08-29 23:56

Also: Is there any database for all the k-b-b primes? If so, can you link me to it? If not, I'll start my own via a new thread. I will begin where b > 60. I don't wish to waste time looking for small primes.

Okay: Using prime k-b-b: For b =2; The 4n + 1 primes (Pythagorean primes)
b = 3; 27n + 1 primes.
b = 5: 3125n + 1 primes.

Etc, etc.

3.14159 2010-08-30 00:02

If there isn't one already: I'll search for k-b-b; k = 1 to 10[sup]4[/sup]

Also: Correct b > 60 to b ≥ 60.

CRGreathouse 2010-08-30 00:02

[QUOTE=3.14159;227590]By the way: Have you discovered any primes of any significant size, for items 1-19?[/QUOTE]

I haven't looked for any except #16. Well, technically I'm looking for a prime of the form 2^n-2293 which fits into a few of your categories, but that's been going on for a while now, it's not prompted by your categories.

3.14159 2010-08-30 00:04

[QUOTE=CRGreathouse]Well, technically I'm looking for a prime of the form 2^n-2293 which fits into a few of your categories, but that's been going on for a while now, it's not prompted by your categories.[/QUOTE]

What's your n-range?

Alternatively: What size are you aiming for? Is it top 5000 worthy?

Also: Reply concerning Posts 1130 and 1131?

Apologies if I came off as a bit inquisitive here.

CRGreathouse 2010-08-30 00:25

[QUOTE=3.14159;227595]Also: Reply concerning Posts 1130 and 1131?[/QUOTE]

I know nothing. I have no particular interest in this sort of prime search; others on these boards know much more than I.

[QUOTE=3.14159;227595]What's your n-range?

Alternatively: What size are you aiming for? Is it top 5000 worthy?[/QUOTE]

I'm looking for the smallest prime of that form. Unfortunately it looks like that might be pretty big. :down:

I'm searching discontinuous ranges, but there are no candidates remaining with n < 700,000, and I have checked only a few with n > 1,000,000.

3.14159 2010-08-30 00:28

[QUOTE=CRGreathouse]I know nothing. I have no particular interest in this sort of prime search; others on these boards know much more than I.
[/QUOTE]

The best test is to start the thread and keep it going until someone gave me a link to a database.

[QUOTE=CRGreathouse]I'm searching discontinuous ranges, but there are no candidates remaining with n < 700,000, and I have checked only a few with n > 1,000,000.
[/QUOTE]

Did you check every exponent below 700k?

CRGreathouse 2010-08-30 00:35

[QUOTE=3.14159;227598]Did you check every exponent below 700k?[/QUOTE]

Yes, either by sieving or direct testing.

Do you know if there is any project that tests numbers like this?

3.14159 2010-08-30 00:45

[QUOTE=CRGreathouse]Yes, either by sieving or direct testing.

Do you know if there is any project that tests numbers like this?[/QUOTE]

b^n - c primes? Besides Mersennes, I'm not sure.

Hey: I've started the thread for k-b-b's:

[URL="http://www.mersenneforum.org/showthread.php?t=13797"]Check it out.[/URL]

CRGreathouse 2010-08-30 00:47

[QUOTE=3.14159;227592]Also: Is there any database for all the k-b-b primes? If so, can you link me to it? If not, I'll start my own via a new thread. I will begin where b > 60. I don't wish to waste time looking for small primes.

Okay: Using prime k-b-b: For b =2; The 4n + 1 primes (Pythagorean primes)
b = 3; 27n + 1 primes.
b = 5: 3125n + 1 primes.

Etc, etc.[/QUOTE]

For constant b:
[url]http://oeis.org/classic/A000040[/url]
[url]http://oeis.org/classic/A002144[/url]
[url]http://oeis.org/classic/A141948[/url]
. . .

For constant k:
[url]http://oeis.org/classic/A121270[/url]
2*1^1+1, 2*12^12+1, 2*18^18+1, 2*251^251+1, ... (see [url]http://oeis.org/classic/A110932[/url] )
3*2^2+1, 3*4^4+1, 3*6^6+1, 3*10^10+1, 3*286^286+1, 3*450^450+1, ...

Constant-b sequences are plain-vanilla Dirichlet's theorem sequences with well-studied behavior. Constant-k sequences are much more interesting to me, but they grow too quickly to collect many members. (Heuristically, they have log log x members up to x?) A diagonal slice (first term for b = 1, 2, ...) would also be nice.

Edit: The diagonal sequence is
[url]http://oeis.org/classic/A070855[/url]
and should be controlled by Linnik's theorem, though the sequence doesn't seem to mention it. :(

3.14159 2010-08-30 03:40

Hey: Where are you up to in computing the smallest k for which k * b[sup]b[/sup] + 1 ? On the ks between 1 and 10k: I'm up to b = 177

CRGreathouse 2010-08-30 03:48

[QUOTE=3.14159;227620]Hey: Where are you up to in computing the smallest k for which k * b[sup]b[/sup] + 1 ?[/QUOTE]

608. But I'm not even devoting a full core to it at the moment.

The first 385 are all that will fit in a b-file, but I figure I can submit a new sequence (in October -- the OEIS is on hiatus through September) with the k-values only.

3.14159 2010-08-30 03:51

[QUOTE=CRGreathouse]608. But I'm not even devoting a full core to it at the moment.
[/QUOTE]

Ah. Excellent. I just need 20-40 minutes to complete my search for k-b-b's up to b = 250, thus completing my first file.

I think I need to start using the programs after about 300, as the primes become too large for PARI's APR-CL to prove.

CRGreathouse 2010-08-30 04:00

[QUOTE=3.14159;227622]I think I need to start using the programs after about 300, as the primes become too large for PARI's APR-CL to prove.[/QUOTE]

Certainly if you want to find a lot of primes you would do best to use programs that can sieve. Since I'm only looking for the first example the benefits are smaller. A bit of sieving would be nice, if I could automate it properly, but right now CPU time is cheap and human time expensive.

I think you should put your files up on a web page -- or maybe a Google doc -- rather than on the forum. This way you could update them rather than make new posts....

3.14159 2010-08-30 04:03

[QUOTE=CRGreathouse]I think you should put your files up on a web page -- or maybe a Google doc -- rather than on the forum. This way you could update them rather than make new posts....
[/QUOTE]

A webpage? Only if I had the money to pay for upkeep. No, wait, freewebs sites. Thank you for the idea.

3.14159 2010-08-30 04:29

I guess I am unable to do much uploading, as the network is failing yet again.

CRGreathouse 2010-08-30 04:35

[QUOTE=3.14159;227628]I guess I am unable to do much uploading, as the network is failing yet again.[/QUOTE]

Not a big deal -- you're the one doing the calculation at the moment, and as long as that work is able to continue there's no problem in waiting a day, or even a week, to update.

3.14159 2010-08-30 04:38

[QUOTE=CRGreathouse]Not a big deal -- you're the one doing the calculation at the moment, and as long as that work is able to continue there's no problem in waiting a day, or even a week, to update.[/QUOTE]

Any programs that you would recommend me using for the larger primes?

My current idea is NewPGen + PFGW + Proving it prime with Proth.exe

And:

912646 * 798336[sup]20160[/sup] + 1 is prime! :party: (Approx. 119000 digits)

CRGreathouse 2010-08-30 04:42

[QUOTE=3.14159;227630]Any programs that you would recommend me using for the larger primes?[/QUOTE]

Not particularly. As long as your basic setup is sieve + probable prime test + primality proving, you're pretty well set.

3.14159 2010-08-30 04:44

Now, that find lifted a load of CPU usage off the computer. :smile: It reduced it by 40% !

[QUOTE=CRGreathouse]Not particularly. As long as your basic setup is sieve + probable prime test + primality proving, you're pretty well set.
[/QUOTE]

Sieve: NewPGen or Vk.

PRP Test: PFGW or LLR.

Primality proof: Proth.exe (Items 1, 2, 3, 4, 8, 9, 10, 11, 12, 13, 14, 15)

3.14159 2010-08-30 05:03

Okay: Past 250, programs will be put into use; The primes reach 600 digits by b = 250. Or begin using "isPRP", for PARI.

CRGreathouse 2010-08-30 05:24

[QUOTE=3.14159;227634]Or begin using "isPRP", for PARI.[/QUOTE]

Probably better to use ispseudoprime(), which does a small amount of trial division then a BPSW test. It's coded directly in C which means you get about the same speed as isPRP but a much stronger test.

3.14159 2010-08-30 05:30

Okay: Completed the file for b = 60 to 250.

Now: For 251 to 500.

CRGreathouse 2010-08-30 06:56

[QUOTE=3.14159;227464]Other members only:

20. n-1 analogues of Proths.
21. n-1 analogues of k-b-b, (k * b[sup]b[/sup] - 1)
22. Twins.

I stay within 1-19. Ban me for a week if I defy that rule.[/QUOTE]

Since Pi's not allowed to participate and no one else has stepped forward, I'll submit 1 * 2^2 - 1 = 3 for #20 and #21 and 3 = 5 - 2 for #22. Primality certificates available on request.

science_man_88 2010-08-30 12:50

obviously even though you told me to post again you don't care of my idea.

CRGreathouse 2010-08-30 13:11

[QUOTE=science_man_88;227663]obviously even though you told me to post again you don't care of my idea.[/QUOTE]

I can't make heads or tails of it.

science_man_88 2010-08-30 13:17

turn this into vectors:

[CODE]for(s=1,50,for(x=s,20000000*s,if(isprime(x),print1(x","));x=x*2);print("<--"s))[/CODE]

then compare with the exponents of Mersenne primes.

some don't fit them so we could say they may never hit them. if we can figure this out we can use it like a sieve.

[CODE]3,7,31,127,8191,131071,524287,<--1
2,5,11,23,47,191,383,6143,786431,<--2
3,7,31,127,8191,131071,524287,<--3
19,79,1279,5119,20479,81919,1310719,<--4
5,11,23,47,191,383,6143,786431,<--5
13,223,3583,917503,14680063,<--6
7,31,127,8191,131071,524287,<--7
17,71,1151,73727,294911,18874367,<--8
19,79,1279,5119,20479,81919,1310719,<--9
[COLOR="Red"]43,[/COLOR]<--10
[COLOR="red"]11,23,47,191,383,6143,786431,[/COLOR]<--11
[COLOR="Red"]103,1663,109051903,[/COLOR]<--12
13,223,3583,917503,14680063,<--13
[COLOR="red"]29,59,239,479,15359,245759,1966079,[/COLOR]<--14
31,127,8191,131071,524287,<--15
[COLOR="red"]67,271,1087,1114111,17825791,[/COLOR]<--16
17,71,1151,73727,294911,18874367,<--17
37,151,607,39845887,<--18
19,79,1279,5119,20479,81919,1310719,<--19
[COLOR="red"]41,83,167,2687,21503,172031,5505023,[/COLOR]<--20
[COLOR="red"]43,[/COLOR]<--[COLOR="DarkOrange"]21[/COLOR]
[COLOR="Red"]367,1471,94207[/COLOR],<--22
[COLOR="Red"]23,47,191,383,6143,786431,[/COLOR]<--[COLOR="DarkOrange"]23[/COLOR]
[COLOR="Red"]199,12799,51199,3276799,209715199,[/COLOR]<--24
[COLOR="red"]103,1663,109051903,[/COLOR]<--[COLOR="DarkOrange"]25[/COLOR]
53,107,431,863,6911,27647,442367,<--26
[COLOR="red"]223,3583,917503,14680063,[/COLOR]<--27
[/CODE]

3.14159 2010-08-30 14:00

[QUOTE=CRGreathouse]Since Pi's not allowed to participate and no one else has stepped forward, I'll submit 1 * 2^2 - 1 = 3 for #20 and #21 and 3 = 5 - 2 for #22. Primality certificates available on request.
[/QUOTE]

Always going with the smallest examples. What exponents are you up to for your 2^n - 2293 search?

Also: I'll get to work on b = 251-500 for k-b-b's.

CRGreathouse 2010-08-30 14:12

[QUOTE=science_man_88;227665]turn this into vectors:

[CODE]for(s=1,50,for(x=s,20000000*s,if(isprime(x),print1(x","));x=x*2);print("<--"s))[/CODE]

then compare with the exponents of Mersenne primes.

some don't fit them so we could say they may never hit them. if we can figure this out we can use it like a sieve.[/QUOTE]

So you're starting at some s and then looking at primes of the form 2^k * (s+1) - 1 for k = 0..24. What are you doing with them? What do you mean by comparing them with the exponents of Mersenne primes?

science_man_88 2010-08-30 14:14

[QUOTE=CRGreathouse;227670]So you're starting at some s and then looking at primes of the form 2^k * (s+1) - 1 for k = 0..24. What are you doing with them? What do you mean by comparing them with the exponents of Mersenne primes?[/QUOTE]

check out s=11 up to the limit of known exponents for Mersenne primes they all aren't in it. so far about 1/3 of all the numbers checked up to 27 have sequences that seem to work like that so far.

CRGreathouse 2010-08-30 14:44

[QUOTE=3.14159;227669]Always going with the smallest examples. What exponents are you up to for your 2^n - 2293 search?[/QUOTE]

Once I close the gap between my disjoint work assignments I'll be up to 920,000. But I still have some work in the lower 700,000s.

3.14159 2010-08-30 14:48

[QUOTE=CRGreathouse]Once I close the gap between my disjoint work assignments I'll be up to 920,000. But I still have some work in the lower 700,000s.
[/QUOTE]

Excellent. I'm nearing b = 300.

So, I've covered every prime under 760 digits so far.

Also: There seems to be a roundoff bug with b = 308 in between 3408 and 4870.

Is this just me?

CRGreathouse 2010-08-30 15:28

[QUOTE=science_man_88;227671]check out s=11 up to the limit of known exponents for Mersenne primes they all aren't in it. so far about 1/3 of all the numbers checked up to 27 have sequences that seem to work like that so far.[/QUOTE]

I can write out the numbers for s = 11, but what do I do with them?

CRGreathouse 2010-08-30 15:29

[QUOTE=3.14159;227675]Also: There seems to be a roundoff bug with b = 308 in between 3408 and 4870.[/QUOTE]

A roundoff bug in what?

3.14159 2010-08-30 15:31

@CRG: Can you make a quick script that asks NewPGen to sieve for a certain base-range?

[QUOTE=CRGreathouse]A roundoff bug in what?
[/QUOTE]

PFGW gets a roundoff bug, something to do with 0.5 > 0.45

This only happens where b = 308; k = 3408 to 4870.

mdettweiler 2010-08-30 15:33

[quote=3.14159;227680]
PFGW gets a roundoff bug, something to do with 0.5 > 0.45

This only happens where b = 308; k = 3408 to 4870.[/quote]
Can you post the details of the bug here? I've run into these myself in the past and if it's the kind of bug I'm thinking of, the PFGW program developer wants to hear about these.


All times are UTC. The time now is 23:20.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.