How can we find out if some number is of the form f(x) in pari?

57 views Asked by At

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?

1

There are 1 answers

0
K.B. On

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 an x such that φ(x)-1 = n