# Carmichael function available in PARI / GP?

Is the Carmichael function $\lambda(n)$ available in PARI / GP or do I have to program it ?

I know the command znorder, but this does not seem to be enough to calculate the carmichael function.

I have programmed the function, but it would nevertheless be nice to know, if there is an easier way to calculate $\lambda(n)$.

• Have you tried asking pari-users list from pari.math.u-bordeaux.fr/lists-index.html? Anyhow, one of PARI/GP experts just told me that you can use znstar(), specifically lambda(n)=znstar(n)[2][1]. But this computes more than what you actually need (the generators). – Alexander Konovalov Jan 13 '14 at 14:01