mersenneforum.org  

Go Back   mersenneforum.org > Math Stuff > Computer Science & Computational Number Theory > PARI/GP

Reply
 
Thread Tools
Old 2010-08-13, 01:02   #342
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
Code:
 d(a,n,x,m)=for(n=a,x,if(t(n*m!+1)!=n,print("trivial composite","factor is",t(n*m!+1)));if(t(n*m!+1)==n,print(n*m!+1)))
Where t(n) is trial division up to nextprime(10^6).

I get the error: "Too many parameters in user-defined function".

I don't see where the excess params are at: I introduced no new variables into the commands. Or is it treating t as a variable?
Can you show me your code for t?

Also, you're computing t(n*m!+1) twice, which you can avoid like so:
Code:
d(a,n,x,m)={
	for(n=a,x,
		if(t(n*m!+1)!=n,
			print("trivial composite","factor is",t(n*m!+1))
		);
		if(t(n*m!+1)==n,
			print(n*m!+1)
		)
	)
};
Code:
d(a,n,x,m)={
	for(n=a,x,
		if(t(n*m!+1)!=n,
			print("trivial composite","factor is",t(n*m!+1))
		,
			print(n*m!+1)
		)
	)
};
using the form
Code:
if(condition, do_if_true, do_if_false)
rather than
Code:
if(condition, do_if_true);if(!condition, do_if_false)
CRGreathouse is offline   Reply With Quote
Old 2010-08-13, 12:21   #343
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

another thing I notice is if you do it for multiplying 3 it starts 3,1,4 as well could this be a pattern continuation ? I'll have to check more but if it every was proven to be the same for higher numbers of them at a time we could say what's the largest index that is 0 Mod prime? number then figure out the mod of the unknown one through that and say only check primes that give a number with digital root x.
science_man_88 is offline   Reply With Quote
Old 2010-08-13, 12:45   #344
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24·3·5·7 Posts
Default

Quote:
Originally Posted by science_man_88
another thing I notice is if you do it for multiplying 3 it starts 3,1,4 as well could this be a pattern continuation ? I'll have to check more but if it every was proven to be the same for higher numbers of them at a time we could say what's the largest index that is 0 Mod prime? number then figure out the mod of the unknown one through that and say only check primes that give a number with digital root x.
Pardon, but, could you explain a bit more adequately?
3.14159 is offline   Reply With Quote
Old 2010-08-13, 12:46   #345
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

175B16 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
another thing I notice is if you do it for multiplying 3 it starts 3,1,4 as well could this be a pattern continuation ? I'll have to check more but if it every was proven to be the same for higher numbers of them at a time we could say what's the largest index that is 0 Mod prime? number then figure out the mod of the unknown one through that and say only check primes that give a number with digital root x.
Are you still talking about the digital roots of A165223? Here are the first few:
3, 1, 4, 1, 4, 4, 1, 1, 4, 7, 4, 4, 4, 1, 1, 1, 1, 4, 4, 4, 7, 7, 7, 7, 4, 1, 4, 4, 1, 1, 4, 7, 4, 4, 7, 7, 7, 4
CRGreathouse is offline   Reply With Quote
Old 2010-08-13, 12:51   #346
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

look:

3*7*31 = 217*3 = 651 6+5+1 = 12 1+2=3
7*31*127 = 27,559 10+18 effectively = 28 2+8 = 10 1+0 = 1
31*127*8191 = 5+6+7+9+6+7 effectively = 40 4+0 = 4

starts 3,1,4

try 5...

3*7*31*127*8191 = 677207307 6+7+7+2+7+3+7 = 39 3+9 = 12 1+2 = 3

however until I use Pari i can't check any further.
science_man_88 is offline   Reply With Quote
Old 2010-08-13, 12:54   #347
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

135338 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
however until I use Pari i can't check any further.
I gave the first 38 above. A few more terms could probably be calculated; I don't remember how far the Mersenne numbers have been verified.
CRGreathouse is offline   Reply With Quote
Old 2010-08-13, 12:58   #348
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Ah, here's a program to get the digital root of a Mersenne number. The digital root of a product is the product of the digital roots, so you can use this if you like.

Code:
drMersenne(expo)={
  lift(Mod(2,9)^expo-1)
};
A43=[2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917];
vector(#A43-1,i,(drMersenne(A43[i])*drMersenne(A43[i+1]))%9)
CRGreathouse is offline   Reply With Quote
Old 2010-08-13, 13:01   #349
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

what I'm saying is for prime numbers so far it looks as though it will always start 3,1,4

if we can get a sequence like the one you have above maybe we can predict modulo of the next Mersenne prime if we could it would possible eliminate some checks.
science_man_88 is offline   Reply With Quote
Old 2010-08-13, 13:08   #350
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

135338 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
if we can get a sequence like the one you have above maybe we can predict modulo of the next Mersenne prime if we could it would possible eliminate some checks.
I've already shown that the sequence takes on all possible values for a Mersenne number with exponent relatively prime to 6. So all we can determine from the sequence is that further Mersenne exponents won't be divisible by 2 or 3.
CRGreathouse is offline   Reply With Quote
Old 2010-08-13, 13:28   #351
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24×3×5×7 Posts
Default

@CRG: I found this number with the following properties:

49152096000^1+1 is prime. (49152096001)
49152096000^2+1 is prime. (2415928541193216000001)

And: 49152096000^3+1 has n^1+1 as its smallest prime factor:

49152096000^3+1 = 49152096001 * 2415928541144063904001

Can you find any other number with these properties?

Oh, wait: This is easy:

3
5
2^3+1 = 9 = 3*3

Last fiddled with by 3.14159 on 2010-08-13 at 13:29
3.14159 is offline   Reply With Quote
Old 2010-08-13, 13:45   #352
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

my idea is this:

Code:
#M  %91  %92  %93
2    3    1    4    x
3    3    1    4
5    3
care to use the data in the table to calculate x ?
science_man_88 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why do I sometimes see all the <> formatting commands when I quote or edit? cheesehead Forum Feedback 3 2013-05-25 12:56
Passing commands to PARI on Windows James Heinrich Software 2 2012-05-13 19:19
Ubiquity commands Mini-Geek Aliquot Sequences 1 2009-09-22 19:33
64-bit Pari? CRGreathouse Software 2 2009-03-13 04:22
Are these commands correct? jasong Linux 2 2007-10-18 23:40

All times are UTC. The time now is 22:38.


Fri Aug 6 22:38:00 UTC 2021 up 14 days, 17:06, 1 user, load averages: 3.65, 3.67, 3.46

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

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.