OFFSET
1,5
COMMENTS
Not all integers give the number of integers less than or equal to some k that are prime to k (Euler totient function A000010): the sequence counts how many of them there are up to n.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
D. Bressoud, CNT.m Computational Number Theory Mathematica package.
FORMULA
a(n) = Sum_{k = 1..n} 1-A264739(k). - Reinhard Zumkeller, Nov 26 2015
a(n) = n - A264810(n). - M. F. Hasler, Aug 15 2021
EXAMPLE
a(16) = 8 since 3, 5, 7, 9, 11, 13, 14, 15 are not values of phi(n) for any n <= 16.
MATHEMATICA
Needs["CNT`"]; tot = 0; Table[If[PhiInverse[n] == {}, tot++]; tot, {n, 100}]
PROG
(Haskell)
a180639 n = a180639_list !! (n-1)
a180639_list = scanl1 (+) $ map ((1 -) . a264739) [1..]
-- Reinhard Zumkeller, Nov 26 2015
(PARI) A180639(n)=sum(k=1, n, !istotient(k)) \\ M. F. Hasler, Aug 15 2021
(PARI) A180639_vec(n, s=0)=vector(n, k, s+=!istotient(k)) \\ M. F. Hasler, Aug 15 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Carmine Suriano, Sep 14 2010
EXTENSIONS
Definition corrected by M. F. Hasler, Sep 01 2021
STATUS
approved