Thread: Pari/GP to PFGW
View Single Post
Old 2017-12-20, 23:59   #1
carpetpool
 
carpetpool's Avatar
 
"Sam"
Nov 2016

14416 Posts
Post Pari/GP to PFGW

Hi,

The following code is to generate prime indices of prime Fibonacci numbers in GP in a certain index range.

Code:
v=[3, 4]; forprime(p=5, 1e5, if(ispseudoprime(fibonacci(p)), v=concat(v, p)));
I find this code very useful for when the fibonacci(p) sequence is replaced by another divisiblity sequence a(p) (defined in GP).

Code:
v=[]; forprime(p=1, 1e5, if(ispseudoprime(a(p)), v=concat(v, p)));
which will list the primes p such that a(p) is prime for (p given in a certain range).

Now the bad thing or catch about this is PARI's pseudoprime(n) function is seemingly slow if n is a (considerably large, say 1000+ digits) pseudoprime (probable prime). Since PARI/GP seems to be fast at generating the terms for a(p), (which PFGW cannot do for all sequences and high-order recurrence relations), can someone come up with a modification to fiabonacci(p) code so that PARI/GP generates the prime-index Fibonacci numbers, and PFGW 3-PRP tests them. (I am aware of PFGW's built-in fibonacci function, however I don't want that being used here because if PARI is able to generate the fibonacci terms, it will also be able to for other sequences, which PFGW can easily PRP test.

Thanks for help.


The following GP code is from here.
carpetpool is offline   Reply With Quote