I use pari very much for my mathematical research. But I couldn't figure out how to find out if a number can be represented as f(x) for some number x and function f. For example, Euler's totient function φ(x) is defined as the number of natural numbers less than x that are relatively prime to x. Now I wanted to figure out that, given a number n, is it representable as φ(x)-1 for some positive integer n? I can't test it for all the positive integers, so how can I do it?
How can we find out if some number is of the form f(x) in pari?
86 views Asked by AudioBubble At
1
For you specific example with Euler's totient function, just use
if (istotient(n + 1, &x), print(x))
. If n + 1 is a totient, the above prints anx
such thatφ(x)-1 = n