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
1
vote
1 answer

In pari-gp, how to find a primitive element of finite field?

Say, I want a finite field containing q^n elements for some prime q and positive n. How to get its primitive element?
aka_test
  • 27
  • 5
1
vote
1 answer

Embedding keywords in other keywords: context in gtksourceview

I'm writing a syntax highlighting file in gtksourceview for PARI/GP. There's one aspect that has me stuck: I want to highlight certain keywords only while inside another keyword. In particular, I want one kind of highlighting for "log"…
Charles
  • 11,269
  • 13
  • 67
  • 105
1
vote
1 answer

Highest power of prime dividing a number with PARI/GP

How do I find the highest power of a given prime p dividing a number N with PARI/GP? E. g. if we have p = 7 and N = 3087 we get e = 3 with p^e | N but p^(e+1) not dividing N. I want to avoid a full factorization of the number N.
Ystar
  • 351
  • 1
  • 3
  • 8
1
vote
1 answer

how to use more than one sequence in forstep statement in PARI/GP?

I am trying to write something in PARI/GP. I want to create a vector with the values from 1000 to 41000 in steps of 3000. Therefore, I wanted to use the forstep statement. This works fine if you use 1 sequence.…
1
vote
1 answer

Variable name expected

I am creating a program in GP/Pari foo()= { coefficient = vector(2); coefficient[1] = 1; coefficient[2] = 2; UserNum = Vector(2); UserNum[1] = 1; UserNum[2] = 2; n=2; for( r=1,n, sum = coefficient[r]*…
Computernerd
  • 7,378
  • 18
  • 66
  • 95
1
vote
1 answer

code for LLL algorithm in pari/gp

I know that in PARI/GP the function qflll performs LLL algorithm on a set of bases. However, is it possible for me to look at the code for qflll in the PARI/GP library? Or does anyone know how does the LLL algorithm work in the PARI/GP library?
meta_warrior
  • 389
  • 1
  • 6
  • 18
1
vote
1 answer

New to PARI/GP.. How to use PARI/GP for with h(p-1/q) mod p

I am currently making a script for digital signature algorithm until I met a stumbling block which with a lot of trial and errors, I still can't get through it. There are 3 integers which is stored to p,q,h. Using the above 3, I would like to do g…
John
  • 177
  • 1
  • 4
  • 19
1
vote
1 answer

Pari-gp znorder gives compile error

I run this simple query: for(x=1,10, p=prime(x);a=Mod(100, p);print(a);print(znorder(a))) This gives me: Mod(0, 2) *** at top-level: ...od(100,p);print(a);print(znorder(a));) *** ^------------- …
LeeNeverGup
  • 1,096
  • 8
  • 23
1
vote
1 answer

Wrong result in a PARI-implementation

I tried to implement an algorithm to calculate power towers modulo m. Below the procedure tower should calculate 2^3^...^14^15 (mod m) and tower2 should calculate 15^14^...^3^2 (mod m). But for m = 163 , tower2 produces a wrong answer. I found out…
Peter
  • 214
  • 1
  • 10
1
vote
0 answers

Pari/GP Exceptions/break loops

ellpow(E, P, m) will always throw an exception: *** ellpow: impossible inverse modulo: Mod(x, y). *** Break loop: type 'break' to go back to GP where x and y are integers. I want to trap the value x, without finishing the program in order to use…
gon1332
  • 1,930
  • 1
  • 24
  • 30
1
vote
1 answer

How to get the total length of a Row Vector in PARI/GP

from the divisors of a certain number, im trying to randomly choose a divisor. However i am unable to randomly get a number as i could not find any function that can get me the length of a row…
mister
  • 3,303
  • 10
  • 31
  • 48
1
vote
1 answer

Rounding a number in PARI/GP

I know that the "\p x" command sets the precision for all calculations, but i'm looking for something a bit different. Given a number given computed with high precision, I want to round it to a lower precision for just one part of my code. The…
Dan S
  • 11
  • 2
0
votes
1 answer

Questions on the output of idealprimedec (PARI/GP)

I'm doing some computation with PARI/GP. For some number field K, I need to deal with the splitting of a fixed prime ideal of K in its extensions say L1, L2,... The problem is that when I want to use the command 'idealfactor,' I have to recover K by…
0
votes
0 answers

What does PARI mean by "showing all possibilites"?

I am running this code, unfortunately I have no idea that why it is asking me a yes or no question. Normu(D) = my(k = bnfinit(y^2-D, 1), u = bnfunits(k)[1][1]); nfeltnorm(k, u); { L = List(); forprime (q = 5, 100, if (q%8==5, …
Elei
  • 3
  • 3
0
votes
2 answers

How to solve the error ' [not a vector ]'

I ran this code to find the norm of some fundamnetal units of a biqaudratic number field, but I faced following problem for (q=5, 200, for(p=q+1, 200, if (isprime(p)==1 && isprime(q)==1 ,k1=bnfinit(y^2-2*p,1); k2=bnfinit(y^2-q,1); …
Elei
  • 3
  • 3