![]() |
|
|
#1475 |
|
Aug 2006
3·1,993 Posts |
|
|
|
|
|
|
#1476 |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
|
|
|
|
|
|
#1477 |
|
Aug 2006
3×1,993 Posts |
|
|
|
|
|
|
#1478 |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
|
|
|
|
|
|
#1479 |
|
Aug 2006
3·1,993 Posts |
I have the ideas now, but haven't worked through the math needed to implement them yet. I'll also need to find a system with a fast GCD -- I think GMP 5 has Moller's improvements coded in, so maybe that.
|
|
|
|
|
|
#1480 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
Code:
(13:30) gp > U(x,P,Q)= v=vector(x+1,n,0);v[1]=0;v[2]=1;for(y=3,x+1,v[y]=P*v[y-1]-Q*v[y-2]);print(v); (13:33) gp > V(x,P,Q)= v=vector(x+1,n,0);v[1]=2;v[2]=P;for(y=3,x+1,v[y]=P*v[y-1]-Q*v[y-2]);print(v); |
|
|
|
|
|
#1481 |
|
Aug 2006
3·1,993 Posts |
Yes, I like them, but I'd like it better with ";v" instead of ";print(v);". Always return, never print! With the return version you can do fun stuff like isprime(U(7,3,2)).
These are (homogeneous linear) recurrence relations (with constant coefficients); there are many more possibilities. |
|
|
|
|
|
#1482 |
|
"Forget I exist"
Jul 2009
Dumbassville
100000110000002 Posts |
one thing I don't like is Wikipedia doesn't list it under lucas sequences I have a account just I forgot it all lol. maybe if someone remembers they can edit it lol.
|
|
|
|
|
|
#1483 |
|
Aug 2006
10111010110112 Posts |
What is "it"?
|
|
|
|
|
|
#1484 |
|
"Forget I exist"
Jul 2009
Dumbassville
838410 Posts |
Mersenne numbers it doesn't list them as a famous example in http://en.wikipedia.org/wiki/Lucas_sequence but they are P=3 Q=2
|
|
|
|
|
|
#1485 |
|
Aug 2006
3·1,993 Posts |
That's hard because some definitions require them to have a prime exponent, in which case they're not recurrence relations.
|
|
|
|
![]() |
| 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 |