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

Can I use pass-by-reference to change the size of a container?

I want my function to add an element to the end of a container, particularly a matrix. It seems that I can use pass-by-reference to alter an existing element within a container, but if I try to alter the size of the container using concat() I get…
Joe
  • 59
  • 6
0
votes
0 answers

How can I create a vector of subsets in Pari/GP?

I want to produce a vector containing all k-element subsets of a second vector. I know that I can do this by applying vecextract with each k-element subset of the natural numbers 1...n to my original vector. How can I create that vector of subsets…
Joe
  • 59
  • 6
0
votes
2 answers

How can I improve the lindep function's applicability in Pari/GP for integral approximations?

While doing certain computations involving the Rogers L-function, the following result was generated by Wolfram Alpha:                                I wanted to verify this result in Pari/GP by means of the lindep function, so I calculated the…
Max Muller
  • 341
  • 1
  • 3
  • 10
0
votes
1 answer

Looping through keys in Map() object

I'm working with Map() and need an efficient method to loop through all the keys. Specifically the keys are non matrices, and the image is a t_List of real vectors. My current method is to turn the Map into a matrix and loop through like below M =…
0
votes
1 answer

Plothraw PARIGP (or similar) doesn't work (latexit crash)

I'm a new user of PARI/GP, and after writing my script, I wanted to make a graph of it. As my function take an integer and return a number, it's closer to a sequence. Actually, I didn't know how to do it, so I read the documentation of PARI/GP, and…
Mathuser
  • 3
  • 2
0
votes
2 answers

Checking for a counterexample to a conjecture on even deficient-perfect numbers using Pari-GP

I am trying to check for counterexamples to the conjecture stated in this MSE question, using the Pari-GP interpreter of Sage Cell Server. I reproduce the statement of the conjecture here: If N > 8 is an even deficient-perfect number and Q = N/(2N -…
0
votes
0 answers

How to write an iterated function in Pari/GP

I am absolutely new to pari/gp. After watching a few videos on YouTube and looking through some online pdf tutorial files, 5 hours later I am still at a loss on how to write the iterated function below. I was using Excel but needed something that…
Math777
  • 101
  • 1
0
votes
2 answers

Is there a better way to extract the digits of a real number using Pari/GP?

Here's my current code, but it's ugly and I'm worried about possible edge cases from very large or small numbers. Is there a better way to do this? real_to_int(n)={ if(n==floor(n),return(floor(n))); \\ If "n" is a whole number we're done …
Joe
  • 59
  • 6
0
votes
3 answers

How do you get bit_length() in PARI/GP

I've looked on google and couldn't find the answer and thought i'd ask PARI/GP users here. My question is simply How do you get bit_length() in PARI/GP, that you can use at there interpreter here: https://pari.math.u-bordeaux.fr/gp.html
oppressionslayer
  • 6,942
  • 2
  • 7
  • 24
0
votes
1 answer

Possible bug in matsolve method in PARI/GP

When I gave insufficient size of matrices to matsolve(M, B) method, I took a segmentation fault instead of warning. *** matsolve: bug in PARI/GP (Segmentation Fault), please report. With correct size of matrices, I got wrong result. Here is my…
karakale
  • 126
  • 11
0
votes
2 answers

How to compute and evaluate composite function in GP?

I found a workaround to make composite function, but I believe there should be a better way to do this: ? f = x^2 %1 = x^2 ? g = x^3 %2 = x^3 ? x = g %3 = x^3 ? fog = eval(f) %4 = x^6 ? x = 2 %5 = 2 ? result = eval(fog) %6 = 64 In this…
karakale
  • 126
  • 11
0
votes
1 answer

RSA and convergents

I'm trying to do a function in PARI that computes a^(c*q_t) mod n; where c and n are such big numbers, and q_t is the denominator of a convergent of n/c. This is for RSA purposes. I'd just like to improve this function, so that computer would do it…
Anonymous
  • 49
  • 1
  • 9
0
votes
1 answer

Stack Overflow when using gp2c but not when using gp directly with the same program (PARI/GP)

So I wanted to calculate a sum from a particular projecteuler question using gp. Here's the, admittedly unreadable, code: { n = 10000; m=100; sum(k=1,n,eulerphi(k),0.) - (sum(k=1,n,eulerphi(k)*(k * binomial(n-k,m-1) + sum(p = max(m + k - n - 1,1),…
Oussema
  • 103
  • 3
0
votes
1 answer

Is there a more efficient way of nesting logarithms?

This is a continuation of the two questions posted here, Declaring a functional recursive sequence in Matlab Nesting a specific recursion in Pari-GP To make a long story short, I've constructed a family of functions which solve the tetration…
Richard Diagram
  • 209
  • 1
  • 7
0
votes
1 answer

Nesting a specific recursion in Pari-GP

everyone! I've posted a similar problem, initially on Stackexchange; it was moved here and can be found at the link: Declaring a functional recursive sequence in Matlab I'm trying to do something similar in this post, but I've figured that Matlab…
Richard Diagram
  • 209
  • 1
  • 7