

A002088


Sum of totient function: a(n) = Sum_{k=1..n} phi(k), cf. A000010.
(Formerly M1008 N0376)


114



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
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,3


COMMENTS

Number of elements in the set {(x,y): 1 <= x <= y <= n, 1=gcd(x,y)}.  Michael Somos, Jun 13 1999
Sum_{k=1..n} phi(k) gives the number of distinct arithmetic progressions which contain an infinite number of primes and whose difference does not exceed n. E.g., {1k+1}, {2k+1}, {3k+1, 3k+2}, {4k+1, 4k+3}, {5k+1, ..5k+4} means 10 sequences.  Labos Elemer, May 02 2001
The quotient A024916(n)/a(n) = SummatorySigma/SummatoryTotient as n increases seems to approach Pi^4/36 = zeta(2)^2 = A098198 ~2.705808084277845.  Labos Elemer, Sep 20 2004 (corrected by Peter Pein, Apr 28 2009)
Also the number of rationals p/q in (0,1] with denominators q<=n.  Franz Vrabec, Jan 29 2005
a(n) is the number of initial segments of Beatty sequences for real numbers > 1, cut off when the next term in the sequence would be >= n. For example, the sequence 1,2 is included for n=3 and n=4, but not for n >= 5 because the next term of the Beatty sequence must be 3 or 4. Problem suggested by David W. Wilson.  Franklin T. AdamsWatters, Oct 19 2006
Number of complex numbers satisfying any one of {x^1=1, x^2=1, x^3=1, x^4=1, x^5=1, ..., x^n=1}.  Paul Smith (math.idiot(AT)gmail.com), Mar 19 2007
a(n+2) equals the number of Sturmian words of length n which are 'special', prefix of two Sturmian words of length n+1.  Fred Lunnon, Sep 05 2010
Also number of elements in the set {(x,y): 1 <= x + y <= n, x >= 0, y > 0, with x and y relatively prime integers}. Thus, the number of reduced rational numbers x/y with x nonnegative, y positive, and x + y <= n. (For n >= 1, 0 <= x/y <= n  1, clearly including each integer in this interval.)  Rick L. Shepherd, Apr 08 2014
This function, the partial sums of phi = A000010, is sometimes denoted by (uppercase) Phi.  M. F. Hasler, Apr 18 2015
For n >= 1: a(n) is the number of perfect arched semimeander solutions with n arches. To be perfect the number of arch groupings must equal the number of arches with a length of 1 in the current generation and every preceding generation.
Example: p is the number of arches with length 1 (/\), g is the number of arch groups (), n is number of arches in the top half of a semimeander solution
/\
/\ //\\
//\\/\///\\\ n=6 p=3 g=3 Each preceding arch configuration
/\ /\ is formed by attaching the arch
/\//\\//\\ n=5 p=3 g=3 end in the first position and the
/\ arch end in the last position.
//\\
///\\\/\ n=4 p=2 g=2
/\
//\\/\ n=3 p=2 g=2
/\/\ n=2 p=2 g=2
/\ n=1 p=1 g=1. (End)
a(n) is the number of distinct lists of binary words of length n that are balanced (Sturmian).  Dan Rockwell, Will Wodrich, Aaliyah Fiala, and Bob Burton, May 30 2019


REFERENCES

A. Beiler, Recreations in the Theory of Numbers, Dover Publications, 1966, Chap. XVI.
Steven R. Finch, Mathematical Constants, Cambridge, 2003, pp. 115119.
Sarah BocktingConrad, Yevgenia Kashina, T. Kyle Petersen, Bridget Eileen Tenner, Sós Permutations, arXiv:2007.01132
R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. AddisonWesley, 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. 710.
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, McGrawHill, NY, 1939, p. 111.


LINKS

J. J. Sylvester, The collected mathematical papers of James Joseph Sylvester, vol. 2, vol. 3, vol. 4.


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
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


EXAMPLE

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 + ...


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 *)


PROG

(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
(Haskell)
a002088 n = a002088_list !! n
(GAP) List([1..60], n>Sum([1..n], i>Phi(i))); # Muniru A Asiru, Jul 31 2018
(Magma) [&+[EulerPhi(i): i in [1..n]]: n in [1..60]]; // Vincenzo Librandi, Aug 01 2018
(Sage) [sum(euler_phi(k) for k in (1..n)) for n in (0..60)] # G. C. Greubel, Nov 25 2018
(Python)
from functools import lru_cache
@lru_cache(maxsize=None)
if n == 0:
return 0
c, j = 0, 2
k1 = n//j
while k1 > 1:
j2 = n//k1 + 1
j, k1 = j2, n//j2


CROSSREFS



KEYWORD

nonn,easy,nice


AUTHOR



EXTENSIONS



STATUS

approved



