![]() |
|
|
#1332 |
|
Mar 2006
Germany
22·727 Posts |
|
|
|
|
|
|
#1333 |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Title is corrected.
|
|
|
|
|
|
#1334 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
his sequence he gave is A180469 (already up by him) and it's not the p values it's the full values he listed.
|
|
|
|
|
|
#1335 |
|
Mar 2006
Germany
22×727 Posts |
The title says "Primes such that p * 100 + 1 is also prime."
But to which value is p*100+1 also prime? The word "Primes" and "p*100+1 also prime" refer to different values! "also prime" to the value p obviously meant, so p has to be listed here, not p*100+1! PS: And the given PARI code is also false Code:
p10n(a, x) = { for(n=a, x, if(isprime(n)&isprime(n*10^2+1), print(10^2+1)) )};
Correct like this: "Primes p such that p*100+1 also prime" "Values: 7, 13, 19, 37, 61, 67, ..." Last fiddled with by kar_bon on 2010-09-06 at 22:45 |
|
|
|
|
|
#1336 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
|
|
|
|
|
|
#1337 | |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
Quote:
|
|
|
|
|
|
|
#1338 | |
|
Aug 2006
3·1,993 Posts |
Quote:
Code:
forallprime(start,stop,ff)={
my(d=default(primelimit));
if (type(ff) != "T_CLOSURE", error("ff must be a function! For example, forallprime(10,100,n->print(n))"));
forprime(p=start,min(stop,d), ff(p));
if(stop > d,
print("\nWarning, "stop" > primelimit, calculation may be slow");
for(n=precprime(d)+1, stop,
if(isprime(n), ff(n))
)
)
};
addhelp(forallprime, "forallprime(start, stop, ff): Executes the closure (function) ff for all the primes between start and stop.");
|
|
|
|
|
|
|
#1339 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
I'm useless as this code appears to do nothing useful no matter what I do if i try to print the result it give me an error oddly if i use next() as well it doesn't give me that error but it only prints once and only exactly what I type even if it's a variable you use, plus the added bonus of not throwing a out of limits error if i go over primelimit.
|
|
|
|
|
|
#1340 |
|
Aug 2006
3×1,993 Posts |
Sorry, typo... replace T_CLOSURE with t_CLOSURE. (That'll teach me to post without checking my programs!)
|
|
|
|
|
|
#1341 | |
|
"Forget I exist"
Jul 2009
Dumbassville
203008 Posts |
Quote:
211,474,722,816 249,515,175,936 008,002,691,072 006,624,665,600 475,617,255,424 bytes if i did the math right apparently doing math visually on here isn't a good way although I got nearly accurate I get 372 as the ending by calculator. Last fiddled with by science_man_88 on 2010-09-07 at 21:26 |
|
|
|
|
|
|
#1342 |
|
Aug 2006
135338 Posts |
Depends on what size primes you store and how you store them, naturally.
|
|
|
|
![]() |
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 |