0

I have a code in Pari gp that searches for pairs of (a(x),b(x)) for which a given value of x makes them prime. How can I return the total number of i that makes both a(x) and b(x) both prime

a(x) =x power 8 + 1
b(x) = x power 10 + 1

for (i=2,5,if(isprime(a(x)==1,if(isprime(b(x)==1,print([i,ax,bx]))
Andrew
  • 873
  • 4
  • 10

1 Answers1

0

Your code doesn't work. Definitions for a,b are not PARI; parenthesis don't match; Are are x and i intended to be the same? and if not what is x?

A second problem is that b(i) will never be prime since factor(x^10 + 1) has two distinct factors.

If I understand what you are trying to accomplish I suggest the following, but the answer is always 0 for the reason given above.

a(x)=x^8 + 1
b(x)=x^10 + 1
sum(i=2,100,isprime(a(i)) && isprime(b(i)))
Andrew
  • 873
  • 4
  • 10