Questions tagged [pari-gp]

Questions about the computer algebra system PARI/GP, including questions about the GP scripting language and the gp interactive shell. Please use the tag [pari] for the PARI C library.

The description in the tag exerpt is a direct quotation from the PARI/GP Development Headquarters, taken on Apr. 5, 2013. This tag is intended for questions about the computer algebra system PARI/GP, including questions about the GP scripting language and the gp interactive shell. See the separate tag for the PARI C library.

114 questions
0
votes
2 answers

Returning the factors of a polynomial as a vector in Pari/GP

When using factor, Pari prints the factors of a polynomial and their multiplicities. When using, say, polcyclofactors, however, the cyclotomic factors of the polynomial are listed as a vector, without multiplicity. Is there are way to mimic…
Mystery_Jay
  • 161
  • 5
0
votes
1 answer

Writing a code for a path graph in Pari/GP

I am trying to write a matrix for the adjacency matrix of the path graph on n vertices in Pari. For sake of clarity, when I say the graph P_n, I mean the graph with n vertices and n-1 edges. So far, I have managed to do this for specific…
Mystery_Jay
  • 161
  • 5
0
votes
2 answers

How to get the power series G(z^2) from G(z)

I think it's an easy question, but I can't find how to do it correctly. substpol works almost as I need, but doubles the polynomial degree. For example, with : G(z)=1+2*z+3*z^2+O(z^5) I got: substpol(1+2*z^2+3*z^3 + O(z^5),z,z^2) %20 = 1 + 2*z^4…
Damien
  • 300
  • 1
  • 8
0
votes
1 answer

Removing Cyclotomic Factors from a Polynomial - Pari

I want to take some polynomial f and remove all of it's cyclotomic factors, and then look at the resulting polynomial (say g). I'm aware of polcyclofactors and the current code I have tried…
Mystery_Jay
  • 161
  • 5
0
votes
1 answer

writing an output to a file in Gp Pari

I'm running a rather long computation on Gp Pari, and Pari crashed in the middle of the computation, effectively wasting a week of computation time. Before I run the program again, I would like to figure out a way write the outputs to a file as they…
JonHales
  • 125
  • 6
0
votes
1 answer

How to determine which numbers lie within a certain range

I currently have a list of numbers, and I want to know which of these numbers are within a certain range, and what their position is in the list. I'm reasonably new to pari so I'm not sure how exactly to go about this. For a simplistic example of…
Mystery_Jay
  • 161
  • 5
0
votes
1 answer

How to return the size of a set

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…
0
votes
1 answer

Sympy support for Modular groups

Does Sympy support modular groups? I'm looking for something akin to pari/gp's Mod function.
Philippe
  • 1,715
  • 4
  • 25
  • 49
0
votes
1 answer

How can I calculate this prime product faster with PARI/GP?

I want to calculate the product over 1-1/p , where p runs over the primes upto 10^10 I know the approximation exp(-gamma)/ln(10^10) , where gamma is the Euler-Mascheroni-constant and ln the natural logarithm, but I want to calculate the exact…
Peter
  • 214
  • 1
  • 10
0
votes
2 answers

Polynomials in Pari

I have some problems dealing with polynomials in Pari and finding the right commands in the documentation. is it possible to define Polynomials with multiple variables, e.g. f(x,y)=x^2+y^2-1 How can I evaluate a previously defined polynomial (by…
klirk
  • 127
  • 4
0
votes
0 answers

Stack Overflow error in GP

My attepts to tackle computing the norm of an ideal in the 5th cyclotomic field, (denoted K5) polcyclo(5) the polynomial defining the field were successful in PARI/GP. I was also able to find its principal generators and compute more (the command on…
J. Linne
  • 275
  • 4
  • 15
0
votes
1 answer

setsearch in GP/PARI: testing cubic residues

I am trying to write a program in GP/PARI which given a finite field (in this example, I will use the degree 2 field of 9 elements over p=3), computes the cube of all elements and stores it in a list (I understand this is very inefficient). Then, I…
Future
  • 101
0
votes
1 answer

How can I save multi variable results in a data structure using Pari?

I have a function that loops over its input and produces zero or more results, with each result consisting of three numbers. I want to keep those results in a data structure (e.g., a matrix or a vector of vectors) but I don't know how many entries…
Joe
  • 59
  • 6
0
votes
1 answer

Mestre's sum with PARI/GP

I defined Mestre's sum as: S(E, N) = { my (s = 0.0); forprime(p = 2, N, my (a = ellap(E, p)); s += (2-a) / (p+1-a) ); return (s); } and defined polynomials A(t) and B(t) and I wanted to calculate above sum for…
user371596
  • 75
  • 3
0
votes
1 answer

Pair GP polynomial operator

There is trouble with PARI/GP. Does anyone know to operate the right function/command in PARI/GP, for fining the minimal polynomial of [y = x^2-x+1 (mod x^6+x^5+x^4+x^3+x^2+x+1)] PARI/GP gives this error: gp >…
J. Linne
  • 275
  • 4
  • 15