![]() |
|
|
#694 |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
I'm leaning towards the latter being true.
@sm88: Too many arguments, failed to specify whether or not a=1 was part of the command, a=1 treated as its own command Last fiddled with by 3.14159 on 2010-08-19 at 19:19 |
|
|
|
|
|
#695 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
|
|
|
|
|
|
#696 |
|
Aug 2006
3·1,993 Posts |
|
|
|
|
|
|
#697 | |
|
Aug 2006
3×1,993 Posts |
Quote:
|
|
|
|
|
|
|
#698 | |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Quote:
Print nextprime(x), followed by * , followed by nextprime(n), followed by printing the product of those two. In other words, a semiprime generator that gives the factors used to produce the semiprime as well. a(n) = nextprime(random(10^n)). a and f were well-defined. a was never a variable, it is a function. a simply gives an n-digit prime most of the time. Therefore, there was no error in my defined functions. Last fiddled with by 3.14159 on 2010-08-19 at 19:38 |
|
|
|
|
|
|
#699 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
Code:
v=vector(1250,n,0);a=1;for(x=1,10000,if(isprime(x),v[a]=x;a=a+1)) what I want to do is add a 0 into v every time a prime is found so as to have no 0's at the end of it all and to only have the number of indices necessary to list all the primes under a given number once the vector is made I can get a sieve like the sieve of Eratosthenes to try and work with it to create a bigger list instead of asking isprime hopefully I can make a way to check primality quicker and then make a function that uses the vector indices to check Prime2(x). |
|
|
|
|
|
#700 | |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Quote:
|
|
|
|
|
|
|
#701 |
|
Aug 2006
10111010110112 Posts |
Code:
v=vector(1,n,0);
a=1;
for(x=1,10000,
if(isprime(x),
v[a]=x;
concat(v[],0);
a=a+1
)
)
Code:
v=concat(v,0); Here's how I would do what I think you're trying to do: Code:
v=[];
for(x=1,10000,
if(isprime(x),
v=concat(v,x)
)
)
Code:
v=[]; forprime(p=2,10000, v=concat(v,p) ) Code:
v=vector(primepi(10000)); i=0; forprime(p=2,10000, i++; v[i]=p ) Code:
v=vector(primepi(10000)); i=0; forprime(p=2,10000, v[i++]=p ) |
|
|
|
|
|
#702 | |
|
Aug 2006
3×1,993 Posts |
Quote:
|
|
|
|
|
|
|
#703 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
now if I only I could be smart like you so I could build you that helpful program lol.
Last fiddled with by science_man_88 on 2010-08-19 at 19:46 |
|
|
|
|
|
#704 | |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Quote:
|
|
|
|
|
![]() |
| 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 |