mersenneforum.org  

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

Reply
 
Thread Tools
Old 2010-09-06, 18:28   #1321
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

32208 Posts
Default

Primes p such that p*102 + 1 is also prime: 701, 1301, 1901, 3701, 6101, 6701, 7901, 10301, 13901, 15101, 16301, 19301, 21101, 22901, 27701, 42101, 46301, 52301, 54101, 60101, 64301, 70901, 72701, 81101, 82301, 87701, 88301, 93701, 102101, 112901, 115301, 117101, 123701, 132701, 138101, 139901, 144701, 148301, 157901, 159701, 165701, 166301, 174101, 178301, 186701, 193301, 198701, 201101, 201701, 217901, 220301, 226901, 237701, 243701, 247301, 250301, 252101, 253901, 270701, 285101, 291701, etc...

Submitted to OEIS.

Last fiddled with by 3.14159 on 2010-09-06 at 18:38
3.14159 is offline   Reply With Quote
Old 2010-09-06, 18:38   #1322
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
Primes p such that p*102 + 1 is also prime: 701, 1301, 1901, 3701, 6101, 6701, 7901, 10301, 13901, 15101, 16301, 19301, 21101, 22901, 27701, 42101, 46301, 52301, 54101, 60101, 64301, 70901, 72701, 81101, 82301, 87701, 88301, 93701, 102101, 112901, 115301, 117101, 123701, 132701, 138101, 139901, 144701, 148301, 157901, 159701, 165701, 166301, 174101, 178301, 186701, 193301, 198701, 201101, 201701, 217901, 220301, 226901, 237701, 243701, 247301, 250301, 252101, 253901, 270701, 285101, 291701, etc...

There should only be two sequences: One for p * 10n + 1, when n is any integer, and for 100.
so in other words p*10n+1 and p*10100 +1 ?

or

p*10n+1 and p*100n+1 ?
science_man_88 is offline   Reply With Quote
Old 2010-09-06, 18:49   #1323
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24×3×5×7 Posts
Default

Former.
3.14159 is offline   Reply With Quote
Old 2010-09-06, 19:39   #1324
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
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.
what CRG was saying is:

1,4,9,16,25,36,49,64,81,100,121,144,169,196,225,256,....

1,16,81,256,........

1) n2
2) n4
Red) the members in both sequences

see how all the n4 are Red ? since it includes all fourth powers only then it can be stated: within the set of fourth powers, instead of in the set of squares and the set of fourth powers, so the redundancy stays.

Last fiddled with by science_man_88 on 2010-09-06 at 19:40
science_man_88 is offline   Reply With Quote
Old 2010-09-06, 20:51   #1325
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

69016 Posts
Default

Sent the b-file for the first 20000 terms. The 20000th term is 284727701.
3.14159 is offline   Reply With Quote
Old 2010-09-06, 21:29   #1326
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
Code:
(13:45) gp > ifprime(x,p)=if(isprime(x),p)
%11 = (x,p)->if(isprime(x),p)
(13:47) gp > ifprime(100,print(100))
100
I was trying something like this but I can't get it to work. why ? is my best question.
Quote:
Originally Posted by axn View Post
Code:
ifprime(p, s)=if(isprime(p), eval(s));
ifprime(100, "print(p)");
ifprime(101, "print(p)");
101
Quote:
Originally Posted by science_man_88 View Post
I should of known this by now lol thank you though in a way this is useless but it is useful in the fact that it could create shorter code when typing it in. as by the look of it it saves 10 characters I was also thinking of one where you can do a && part in the if I think I'll try that next.
Hats off to axn for understanding the request!

Another way to do it -- the way I'd prefer -- is to pass a closure rather than a string. So
Code:
ifprime(p, s)=if(isprime(p), s(p));
ifprime(100, p -> print(p));
ifprime(101, p -> print(p));
or even
Code:
ifprime(p, s)=if(isprime(p), s(p));
printme(n)=print(n);
ifprime(100, printme);
ifprime(101, printme);
CRGreathouse is offline   Reply With Quote
Old 2010-09-06, 21:35   #1327
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

10111010110112 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
Primes p such that p*102 + 1 is also prime: 701, 1301, 1901, 3701, 6101, 6701, 7901, 10301, 13901, 15101, 16301, 19301, 21101, 22901, 27701, 42101, 46301, 52301, 54101, 60101, 64301, 70901, 72701, 81101, 82301, 87701, 88301, 93701, 102101, 112901, 115301, 117101, 123701, 132701, 138101, 139901, 144701, 148301, 157901, 159701, 165701, 166301, 174101, 178301, 186701, 193301, 198701, 201101, 201701, 217901, 220301, 226901, 237701, 243701, 247301, 250301, 252101, 253901, 270701, 285101, 291701, etc...

Submitted to OEIS.
"Primes p such that p*102 + 1 is also prime" are 7,13,19,37,61,67,79,103,.... "Primes p such that (p*10)2 + 1 is also prime" are 2,11,13,17,23,43,47,89,101,.... I'm not sure what your sequence is!

You should probably discuss your sequences here before submitting so we can iron out the wording and so forth.
CRGreathouse is offline   Reply With Quote
Old 2010-09-06, 22:06   #1328
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

838410 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
"Primes p such that p*102 + 1 is also prime" are 7,13,19,37,61,67,79,103,.... "Primes p such that (p*10)2 + 1 is also prime" are 2,11,13,17,23,43,47,89,101,.... I'm not sure what your sequence is!

You should probably discuss your sequences here before submitting so we can iron out the wording and so forth.
he's using p*10n+1 I believe for one thing he's checking and p*10100 +1 for another I'm unsure about what he's posted as well for once.
science_man_88 is offline   Reply With Quote
Old 2010-09-06, 22:12   #1329
kar_bon
 
kar_bon's Avatar
 
Mar 2006
Germany

55348 Posts
Default

No, he gave the values for p*10^2+1, but as stated "Primes p such..." should list the p-values and not the p*10^2+1 results!

The sequence as submitted is false!

Last fiddled with by kar_bon on 2010-09-06 at 22:14
kar_bon is offline   Reply With Quote
Old 2010-09-06, 22:14   #1330
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by kar_bon View Post
No, he gave the values for p*10^2+1, but as stated "Primes p such..." should list the p-values and not the p*10^2+1 results!

The sequence as submitted is false!
so in other terms:

Code:
forprime(p=1,1500,if(isprime(p*10^2+1),print(p*10^2+1)))
science_man_88 is offline   Reply With Quote
Old 2010-09-06, 22:15   #1331
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

instead of :

Code:
forprime(p=1,1500,if(isprime(p*10^2+1),print(p)))
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 23:12.


Fri Aug 6 23:12:58 UTC 2021 up 14 days, 17:41, 1 user, load averages: 4.28, 4.23, 4.06

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.