A002088 Sum of totient function: a(n) = Sum_{k=1..n} phi(k), cf. A000010.
0, 1, 2, 4, 6, 10, 12, 18, 22, 28, 32, 42, 46, 58, 64, 72, 80, 96, 102, 120, 128, 140, 150, 172, 180, 200, 212, 230, 242, 270, 278, 308, 324, 344, 360, 384, 396, 432, 450, 474, 490, 530, 542, 584, 604, 628, 650, 696, 712, 754, 774, 806, 830, 882, 900, 940, 964
Offset: 0
Examples
G.f. = x + 2*x^2 + 4*x^3 + 6*x^4 + 10*x^5 + 12*x^6 + 18*x^7 + 22*x^8 + 28*x^9 + ...
References
- A. Beiler, Recreations in the Theory of Numbers, Dover Publications, 1966, Chap. XVI.
- Steven R. Finch, Mathematical Constants, Cambridge, 2003, pp. 115-119.
- R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 138.
- M. N. Huxley, The Distribution of Prime Numbers, Oxford Univ. Press, 1972, p. 6.
- D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, pp. 7-10.
- D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section I.21.
- I. Niven and H. S. Zuckerman, An Introduction to the Theory of Numbers. 2nd ed., Wiley, NY, 1966, p. 94, Problem 11.
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 111.
Links
- Al Zimmermann, Table of n, a(n) for n = 0..50000 (Terms 0 to 1000 by T. D. Noe)
- Dorin Andrica, Ovidiu Bagdasar, On some results concerning the polygonal polynomials, Carpathian Journal of Mathematics (2019) Vol. 35, No. 1, 1-11.
- Art of Problem Solving, 2013 IMO Problem 6.
- S. Bockting-Conrad, Y. Kashina, T. K. Petersen, and B. E. Tenner, Sós permutations, arXiv:2007.01132 [math.CO], 2020.
- Rayan Chikhi, Vladan Jovicic, Stefan Kratsch, Paul Medvedev, Martin Milanic, Sofya Raskhodnikova, and Nithin Varma, Bipartite Graphs of Small Readability, arXiv:1805.04765 [cs.DM], 2018.
- Steven R. Finch, Euler Totient Function Asymptotic Constants [Broken link]
- Steven R. Finch, Euler Totient Function Asymptotic Constants [From the Wayback machine]
- Paul Loomis, Michael Plytage and John Polhill, Summing up the Euler phi function, The College Mathematics Journal, Vol. 39, No. 1, Jan. 2008, pp. 34-42.
- J. Sandor, D. S. Mitrinovic, B. Crstici, Handbook of Number Theory I, Volume 1, Springer, 2005, p. 24.
- N. J. A. Sloane, Families of Essentially Identical Sequences, Mar 24 2021 (Includes this sequence)
- James J. Sylvester, On the number of fractions contained in any Farey series of which the limiting number is given, in: London, Edinburgh and Dublin Philosophical Magazine (5th series) 15 (1883), p. 251 = Collected Mathematical Papers, Vols. 1-4, Cambridge Univ. Press, 1904-1912, Vol. 4, p. 103 (see below).
- J. J. Sylvester, The collected mathematical papers of James Joseph Sylvester, vol. 2, vol. 3, vol. 4.
- A. Walfisz, Weylsche Exponentialsummen in der neueren Zahlentheorie, VEB Deutscher Verlag der Wissenschaften, Berlin 1963.
- Eric Weisstein's World of Mathematics, Totient Function
- Eric Weisstein's World of Mathematics, Beatty Sequence.
- Eric Weisstein's World of Mathematics, Totient Summatory Function.
- R. G. Wilson, v, Letter to N. J. A. Sloane, Jan 24 1989
Programs
-
GAP
List([1..60],n->Sum([1..n],i->Phi(i))); # Muniru A Asiru, Jul 31 2018
-
Haskell
a002088 n = a002088_list !! n a002088_list = scanl (+) 0 a000010_list -- Reinhard Zumkeller, Jul 29 2012
-
Magma
[&+[EulerPhi(i): i in [1..n]]: n in [1..60]]; // Vincenzo Librandi, Aug 01 2018
-
Maple
with(numtheory): A002088:=n->add(phi(i),i=1..n): seq(A002088(n), n=0..70);
-
Mathematica
Table[Plus @@ EulerPhi[Range[n]], {n, 0, 57}] (* Alonso del Arte, May 30 2006 *) Accumulate[EulerPhi[Range[0,60]]] (* Harvey P. Dale, Aug 27 2011 *)
-
PARI
a(n)=sum(k=1,n,eulerphi(k)) \\ Charles R Greathouse IV, Jun 16 2011
-
PARI
a(n)=my(s=1); forsquarefree(k=1,n,s+=(n\k[1])^2*moebius(k)); s/2 \\ Charles R Greathouse IV, Oct 15 2021
-
PARI
first(n)=my(v=vector(n),s); forfactored(k=1,n, v[k[1]]=s+=eulerphi(k)); v \\ Charles R Greathouse IV, Oct 15 2021
-
Python
from functools import lru_cache @lru_cache(maxsize=None) def A002088(n): # based on second formula in A018805 if n == 0: return 0 c, j = 0, 2 k1 = n//j while k1 > 1: j2 = n//k1 + 1 c += (j2-j)*(2*A002088(k1)-1) j, k1 = j2, n//j2 return (n*(n-1)-c+j)//2 # Chai Wah Wu, Mar 24 2021
-
Sage
[sum(euler_phi(k) for k in (1..n)) for n in (0..60)] # G. C. Greubel, Nov 25 2018
Formula
a(n) = (3*n^2)/(Pi^2) + O(n log n).
More precisely, a(n) = (3/Pi^2)*n^2 + O(n*(log(n))^(2/3)*(log(log(n)))^(4/3)), (A. Walfisz 1963). - Benoit Cloitre, Feb 02 2003
a(n) = (1/2)*Sum_{k>=1} mu(k)*floor(n/k)*floor(1+n/k). - Benoit Cloitre, Apr 11 2003
A slightly simpler version of Cloitre's formula is a(n) = 1/2 + Sum_{k=1..oo} floor(n/k)^2*mu(k)/2. - Bill Gosper, Jul 25 2020
The quotient A024916(n)/a(n) = SummatorySigma/SummatoryTotient as n increases seems to approach (Pi^4)/36 = Zeta(2)^2 = 2.705808084277845. See also A067282. - Labos Elemer, Sep 21 2004
A024916(n)/a(n) = zeta(2)^2 + O(log(n)/n). This follows from asymptotic formulas for the sequences. - Franklin T. Adams-Watters, Oct 19 2006
Row sums of triangle A134542. - Gary W. Adamson, Oct 31 2007
G.f.: (Sum_{n>=1} mu(n)*x^n/(1-x^n)^2)/(1-x), where mu(n) = A008683(n). - Mamuka Jibladze, Apr 06 2015
a(n) = A005728(n) - 1, for n >= 0. - Wolfdieter Lang, Nov 22 2016
a(n) = (Sum_{k=1..floor(sqrt(n))} k*(k+1) * (M(floor(n/k)) - M(floor(n/(k+1)))) + Sum_{k=1..floor(n/(1+floor(sqrt(n))))} mu(k) * floor(n/k) * floor(1+n/k))/2, where M(k) is the Mertens function (A002321) and mu(k) is the Moebius function (A008683). - Daniel Suteu, Nov 23 2018
a(n) = A015614(n)+1. - R. J. Mathar, Apr 26 2023
a(n) = A000217(n) - Sum{k=2..n} a(floor(n/k)). From summing over Id = 1 (Dirichlet convolution) phi. - Jason Xu, Jul 31 2024
a(n) = Sum_{k=1..n} k*A002321(floor(n/k)). - Ridouane Oudra, Jul 03 2025
Extensions
Additional comments from Len Smiley
Comments