![]() |
|
|
#815 |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Nevermind. I answered my own question. Okay: I can mess with the params as I wish? Cool.
Wait: Does it use the F/trial division switch? Last fiddled with by 3.14159 on 2010-08-24 at 12:26 |
|
|
|
|
|
#816 |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Also: Found 268 * 4200! + 1 (13399 digits). A prime with a prime number of digits. Excellent.
|
|
|
|
|
|
#817 |
|
"Forget I exist"
Jul 2009
Dumbassville
100000110000002 Posts |
Code:
plength(n) = forstep(x=(10^n)+1,10^(n+1),[2],if(isprime(x),return(x))) |
|
|
|
|
|
#818 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
realized why now doh.
|
|
|
|
|
|
#819 |
|
Aug 2006
597910 Posts |
sm: It looks good to me. This is A003617(n+1), right?
Faster would be Code:
plength(n)=nextprime(10^n) |
|
|
|
|
|
#820 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
well it isn't! and I know why.
Code:
(15:42) gp > plength(n) = forstep(x=(10^n)+1,10^(n+1),[2],if(isprime(x),return(x))) %471 = (n)->forstep(x=(10^n)+1,10^(n+1),[2],if(isprime(x),return(x))) (15:43) gp > plength(3) %472 = 1009 (15:43) gp > Code:
(15:45) gp > plength(n) = forstep(x=(10^(n-1))+1,10^(n),[2],if(isprime(x),return(x))) %473 = (n)->forstep(x=(10^(n-1))+1,10^(n),[2],if(isprime(x),return(x))) (15:45) gp > plength(3) %474 = 101 (15:45) gp > |
|
|
|
|
|
#821 |
|
"Forget I exist"
Jul 2009
Dumbassville
20C016 Posts |
I also did this with your knowledge:
Code:
sumdigits(n) = if(n%9!=0,return(n%9),return(n%9+9)) |
|
|
|
|
|
#822 | |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
Quote:
Last fiddled with by science_man_88 on 2010-08-24 at 19:50 |
|
|
|
|
|
|
#823 | |
|
Aug 2006
135338 Posts |
Quote:
Code:
dsum(n,b=10)={
my(s=0);
while(n>=b,
s += n%b;
n \= b;
);
s+n
};
addhelp(dsum, "dsum(n,{b=10}): Sum of the base-b digits of n.");
Last fiddled with by CRGreathouse on 2010-08-24 at 20:04 |
|
|
|
|
|
|
#824 | |
|
Aug 2006
3×1,993 Posts |
Quote:
|
|
|
|
|
|
|
#825 | |
|
Aug 2006
597910 Posts |
Quote:
The set is 'weird' because it has huge gaps, then lots of relatively densely packed elements: no members (strictly) between 10^114 - 153 and 10^126 + 679, a gap of length ~10^126, but then > 3.44218 * 10^123 members in the next 10^126. Last fiddled with by CRGreathouse on 2010-08-24 at 20:16 |
|
|
|
|
![]() |
| 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 |