Max Alekseyev on Thu, 14 Sep 2017 22:31:18 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: eulerphi(0) |
* Max Alekseyev [2017-09-14 21:47]:
> Is there any particular reason behind eulerphi(0) = 2 ?
>
> ? eulerphi(0)
> %1 = 2
>
> I'd rather expect eulerphi(0) to result in an error.
> Zero value would also make more sense, since there are no positive integers
> <=0 (even if we do not care about co-primality).
%%%%%%%%%%%%%%%%%%
(22:15) gp > ??eulerphi
eulerphi(x):
Euler's phi (totient) function of the integer |x|, in other words |(Z/xZ)^*|.
? eulerphi(40)
%1 = 16
According to this definition we let phi(0) := 2, since Z^* = {-1,1}; this
is consistent with znstar(0): we have znstar(n).no = eulerphi(n) for all n
in Z.
%%%%%%%%%%%%%%%%%%
Cheers,
K.B.
--
Karim Belabas, IMB (UMR 5251) Tel: (+33) (0)5 40 00 26 17
Universite de Bordeaux Fax: (+33) (0)5 40 00 21 23
351, cours de la Liberation http://www.math.u-bordeaux.fr/~kbelabas/ Talence (France) http://pari.math.u-bordeaux.
F-33405fr/ [PARI/GP]
`