OFFSET
1,5
COMMENTS
Number of nonprincipal Dirichlet characters mod n. - Charles R Greathouse IV, Jul 25 2013
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
N. J. A. Sloane, Families of Essentially Identical Sequences, Mar 24 2021 (Includes this sequence)
FORMULA
a(n) = phi(n) - 1 = A000010(n) - 1.
a(n) = card({k| k prime to n} setminus {k| k divides n}). - Peter Luschny, Aug 05 2011
G.f.: -x/(1 - x) + Sum_{k >= 1} mu(k)*x^k/(1 - x^k)^2. - Ilya Gutkovskiy, Mar 16 2017
EXAMPLE
a(9) = 5 because 2, 4, 5, 7, 8 are coprime to 9.
a(10) = 3 because 3, 7, 9 are coprime to 10.
MAPLE
A109606 := n -> numtheory[phi](n) - 1: # Peter Luschny, Aug 05 2011
MATHEMATICA
EulerPhi[Range[80]] - 1 (* Alonso del Arte, Sep 16 2017 *)
PROG
(PARI) a(n)=eulerphi(n)-1 \\ Charles R Greathouse IV, Jul 25 2013
(Magma) [EulerPhi(n)-1: n in [1..80]]; // Vincenzo Librandi, Sep 16 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Andrew Weimholt, Jul 31 2005
EXTENSIONS
Definition modified by Reinhard Zumkeller, Mar 03 2009
Offset set to 1, in accordance to A000010, by Peter Luschny, Aug 05 2011
STATUS
approved