cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 21 results. Next

A000005 d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 4, 3, 4, 2, 6, 2, 4, 4, 5, 2, 6, 2, 6, 4, 4, 2, 8, 3, 4, 4, 6, 2, 8, 2, 6, 4, 4, 4, 9, 2, 4, 4, 8, 2, 8, 2, 6, 6, 4, 2, 10, 3, 6, 4, 6, 2, 8, 4, 8, 4, 4, 2, 12, 2, 4, 6, 7, 4, 8, 2, 6, 4, 8, 2, 12, 2, 4, 6, 6, 4, 8, 2, 10, 5, 4, 2, 12, 4, 4, 4, 8, 2, 12, 4, 6, 4, 4, 4, 12, 2, 6, 6, 9, 2, 8, 2, 8
Offset: 1

Views

Author

Keywords

Comments

If the canonical factorization of n into prime powers is Product p^e(p) then d(n) = Product (e(p) + 1). More generally, for k > 0, sigma_k(n) = Product_p ((p^((e(p)+1)*k))-1)/(p^k-1) is the sum of the k-th powers of the divisors of n.
Number of ways to write n as n = x*y, 1 <= x <= n, 1 <= y <= n. For number of unordered solutions to x*y=n, see A038548.
Note that d(n) is not the number of Pythagorean triangles with radius of the inscribed circle equal to n (that is A078644). For number of primitive Pythagorean triangles having inradius n, see A068068(n).
Number of factors in the factorization of the polynomial x^n-1 over the integers. - T. D. Noe, Apr 16 2003
Also equal to the number of partitions p of n such that all the parts have the same cardinality, i.e., max(p)=min(p). - Giovanni Resta, Feb 06 2006
Equals A127093 as an infinite lower triangular matrix * the harmonic series, [1/1, 1/2, 1/3, ...]. - Gary W. Adamson, May 10 2007
For odd n, this is the number of partitions of n into consecutive integers. Proof: For n = 1, clearly true. For n = 2k + 1, k >= 1, map each (necessarily odd) divisor to such a partition as follows: For 1 and n, map k + (k+1) and n, respectively. For any remaining divisor d <= sqrt(n), map (n/d - (d-1)/2) + ... + (n/d - 1) + (n/d) + (n/d + 1) + ... + (n/d + (d-1)/2) {i.e., n/d plus (d-1)/2 pairs each summing to 2n/d}. For any remaining divisor d > sqrt(n), map ((d-1)/2 - (n/d - 1)) + ... + ((d-1)/2 - 1) + (d-1)/2 + (d+1)/2 + ((d+1)/2 + 1) + ... + ((d+1)/2 + (n/d - 1)) {i.e., n/d pairs each summing to d}. As all such partitions must be of one of the above forms, the 1-to-1 correspondence and proof is complete. - Rick L. Shepherd, Apr 20 2008
Number of subgroups of the cyclic group of order n. - Benoit Jubin, Apr 29 2008
Equals row sums of triangle A143319. - Gary W. Adamson, Aug 07 2008
Equals row sums of triangle A159934, equivalent to generating a(n) by convolving A000005 prefaced with a 1; (1, 1, 2, 2, 3, 2, ...) with the INVERTi transform of A000005, (A159933): (1, 1,-1, 0, -1, 2, ...). Example: a(6) = 4 = (1, 1, 2, 2, 3, 2) dot (2, -1, 0, -1, 1, 1) = (2, -1, 0, -2, 3, 2) = 4. - Gary W. Adamson, Apr 26 2009
Number of times n appears in an n X n multiplication table. - Dominick Cancilla, Aug 02 2010
Number of k >= 0 such that (k^2 + k*n + k)/(k + 1) is an integer. - Juri-Stepan Gerasimov, Oct 25 2015
The only numbers k such that tau(k) >= k/2 are 1,2,3,4,6,8,12. - Michael De Vlieger, Dec 14 2016
a(n) is also the number of partitions of 2*n into equal parts, minus the number of partitions of 2*n into consecutive parts. - Omar E. Pol, May 03 2017
From Tomohiro Yamada, Oct 27 2020: (Start)
Let k(n) = log d(n)*log log n/(log 2 * log n), then lim sup k(n) = 1 (Hardy and Wright, Chapter 18, Theorem 317) and k(n) <= k(6983776800) = 1.537939... (the constant A280235) for every n (Nicolas and Robin, 1983).
There exist infinitely many n such that d(n) = d(n+1) (Heath-Brown, 1984). The number of such integers n <= x is at least c*x/(log log x)^3 (Hildebrand, 1987) but at most O(x/sqrt(log log x)) (Erdős, Carl Pomerance and Sárközy, 1987). (End)
Number of 2D grids of n congruent rectangles with two different side lengths, in a rectangle, modulo rotation (cf. A038548 for squares instead of rectangles). Also number of ways to arrange n identical objects in a rectangle (NOT modulo rotation, cf. A038548 for modulo rotation); cf. A007425 and A140773 for the 3D case. - Manfred Boergens, Jun 08 2021
The constant quoted above from Nicolas and Robin, 6983776800 = 2^5 * 3^3 * 5^2 * 7 * 11 * 13 * 17 * 19, appears arbitrary, but interestingly equals 2 * A095849(36). That second factor is highly composite and deeply composite. - Hal M. Switkay, Aug 08 2025

Examples

			G.f. = x + 2*x^2 + 2*x^3 + 3*x^4 + 2*x^5 + 4*x^6 + 2*x^7 + 4*x^8 + 3*x^9 + ...
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 840.
  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 38.
  • G. Chrystal, Algebra: An elementary text-book for the higher classes of secondary schools and for colleges, 6th ed, Chelsea Publishing Co., New York 1959 Part II, p. 345, Exercise XXI(16). MR0121327 (22 #12066)
  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, p. 55.
  • G. H. Hardy and E. M. Wright, revised by D. R. Heath-Brown and J. H. Silverman, An Introduction to the Theory of Numbers, 6th ed., Oxford Univ. Press, 2008.
  • K. Knopp, Theory and Application of Infinite Series, Blackie, London, 1951, p. 451.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Chap. II. (For inequalities, etc.)
  • S. Ramanujan, Collected Papers, Ed. G. H. Hardy et al., Cambridge 1927; Chelsea, NY, 1962. Has many references to this sequence. - N. J. A. Sloane, Jun 02 2014
  • 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).
  • B. Spearman and K. S. Williams, Handbook of Estimates in the Theory of Numbers, Carleton Math. Lecture Note Series No. 14, 1975; see p. 2.1.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 285.
  • E. C. Titchmarsh, The Theory of Functions, Oxford, 1938, p. 160.
  • Terence Tao, Poincaré's Legacies, Part I, Amer. Math. Soc., 2009, see pp. 31ff for upper bounds on d(n).

Crossrefs

See A002183, A002182 for records. See A000203 for the sum-of-divisors function sigma(n).
For partial sums see A006218.
Factorizations into given number of factors: writing n = x*y (A038548, unordered, A000005, ordered), n = x*y*z (A034836, unordered, A007425, ordered), n = w*x*y*z (A007426, ordered).
Cf. A098198 (Dgf at s=2), A183030 (Dgf at s=3), A183031 (Dgf at s=3).

Programs

  • GAP
    List([1..150],n->Tau(n)); # Muniru A Asiru, Mar 05 2019
    
  • Haskell
    divisors 1 = [1]
    divisors n = (1:filter ((==0) . rem n)
                   [2..n `div` 2]) ++ [n]
    a = length . divisors
    -- James Spahlinger, Oct 07 2012
    
  • Haskell
    a000005 = product . map (+ 1) . a124010_row  -- Reinhard Zumkeller, Jul 12 2013
    
  • Julia
    function tau(n)
        i = 2; num = 1
        while i * i <= n
            if rem(n, i) == 0
                e = 0
                while rem(n, i) == 0
                    e += 1
                    n = div(n, i)
                end
                num *= e + 1
            end
            i += 1
        end
        return n > 1 ? num + num : num
    end
    println([tau(n) for n in 1:104])  # Peter Luschny, Sep 03 2023
  • Magma
    [ NumberOfDivisors(n) : n in [1..100] ]; // Sergei Haller (sergei(AT)sergei-haller.de), Dec 21 2006
    
  • Maple
    with(numtheory): A000005 := tau; [ seq(tau(n), n=1..100) ];
  • Mathematica
    Table[DivisorSigma[0, n], {n, 100}] (* Enrique Pérez Herrero, Aug 27 2009 *)
    CoefficientList[Series[(Log[1 - q] + QPolyGamma[1, q])/(q Log[q]), {q, 0, 100}], q] (* Vladimir Reshetnikov, Apr 23 2013 *)
    a[ n_] := SeriesCoefficient[ (QPolyGamma[ 1, q] + Log[1 - q]) / Log[q], {q, 0, Abs@n}]; (* Michael Somos, Apr 25 2013 *)
    a[ n_] := SeriesCoefficient[ q/(1 - q)^2 QHypergeometricPFQ[ {q, q}, {q^2, q^2}, q, q^2], {q, 0, Abs@n}]; (* Michael Somos, Mar 05 2014 *)
    a[n_] := SeriesCoefficient[q/(1 - q) QHypergeometricPFQ[{q, q}, {q^2}, q, q], {q, 0, Abs@n}] (* Mats Granvik, Apr 15 2015 *)
    With[{M=500},CoefficientList[Series[(2x)/(1-x)-Sum[x^k (1-2x^k)/(1-x^k),{k,M}],{x,0,M}],x]] (* Mamuka Jibladze, Aug 31 2018 *)
  • MuPAD
    numlib::tau (n)$ n=1..90 // Zerinvary Lajos, May 13 2008
    
  • PARI
    {a(n) = if( n==0, 0, numdiv(n))}; /* Michael Somos, Apr 27 2003 */
    
  • PARI
    {a(n) = n=abs(n); if( n<1, 0, direuler( p=2, n, 1 / (1 - X)^2)[n])}; /* Michael Somos, Apr 27 2003 */
    
  • PARI
    {a(n)=polcoeff(sum(m=1, n+1, sumdiv(m, d, (-log(1-x^(m/d) +x*O(x^n) ))^d/d!)), n)} \\ Paul D. Hanna, Aug 21 2014
    
  • Python
    from sympy import divisor_count
    for n in range(1, 20): print(divisor_count(n), end=', ') # Stefano Spezia, Nov 05 2018
    
  • Sage
    [sigma(n, 0) for n in range(1, 105)]  # Zerinvary Lajos, Jun 04 2009
    

Formula

If n is written as 2^z*3^y*5^x*7^w*11^v*... then a(n)=(z+1)*(y+1)*(x+1)*(w+1)*(v+1)*...
a(n) = 2 iff n is prime.
G.f.: Sum_{n >= 1} a(n) x^n = Sum_{k>0} x^k/(1-x^k). This is usually called THE Lambert series (see Knopp, Titchmarsh).
a(n) = A083888(n) + A083889(n) + A083890(n) + A083891(n) + A083892(n) + A083893(n) + A083894(n) + A083895(n) + A083896(n).
a(n) = A083910(n) + A083911(n) + A083912(n) + A083913(n) + A083914(n) + A083915(n) + A083916(n) + A083917(n) + A083918(n) + A083919(n).
Multiplicative with a(p^e) = e+1. - David W. Wilson, Aug 01 2001
a(n) <= 2 sqrt(n) [see Mitrinovich, p. 39, also A046522].
a(n) is odd iff n is a square. - Reinhard Zumkeller, Dec 29 2001
a(n) = Sum_{k=1..n} f(k, n) where f(k, n) = 1 if k divides n, 0 otherwise (Mobius transform of A000012). Equivalently, f(k, n) = (1/k)*Sum_{l=1..k} z(k, l)^n with z(k, l) the k-th roots of unity. - Ralf Stephan, Dec 25 2002
G.f.: Sum_{k>0} ((-1)^(k+1) * x^(k * (k + 1)/2) / ((1 - x^k) * Product_{i=1..k} (1 - x^i))). - Michael Somos, Apr 27 2003
a(n) = n - Sum_{k=1..n} (ceiling(n/k) - floor(n/k)). - Benoit Cloitre, May 11 2003
a(n) = A032741(n) + 1 = A062011(n)/2 = A054519(n) - A054519(n-1) = A006218(n) - A006218(n-1) = 1 + Sum_{k=1..n-1} A051950(k+1). - Ralf Stephan, Mar 26 2004
G.f.: Sum_{k>0} x^(k^2)*(1+x^k)/(1-x^k). Dirichlet g.f.: zeta(s)^2. - Michael Somos, Apr 05 2003
Sequence = M*V where M = A129372 as an infinite lower triangular matrix and V = ruler sequence A001511 as a vector: [1, 2, 1, 3, 1, 2, 1, 4, ...]. - Gary W. Adamson, Apr 15 2007
Sequence = M*V, where M = A115361 is an infinite lower triangular matrix and V = A001227, the number of odd divisors of n, is a vector: [1, 1, 2, 1, 2, 2, 2, ...]. - Gary W. Adamson, Apr 15 2007
Row sums of triangle A051731. - Gary W. Adamson, Nov 02 2007
Sum_{n>0} a(n)/(n^n) = Sum_{n>0, m>0} 1/(n*m). - Gerald McGarvey, Dec 15 2007
Logarithmic g.f.: Sum_{n>=1} a(n)/n * x^n = -log( Product_{n>=1} (1-x^n)^(1/n) ). - Joerg Arndt, May 03 2008
a(n) = Sum_{k=1..n} (floor(n/k) - floor((n-1)/k)). - Enrique Pérez Herrero, Aug 27 2009
a(s) = 2^omega(s), if s > 1 is a squarefree number (A005117) and omega(s) is: A001221. - Enrique Pérez Herrero, Sep 08 2009
a(n) = A048691(n) - A055205(n). - Reinhard Zumkeller, Dec 08 2009
For n > 1, a(n) = 2 + Sum_{k=2..n-1} floor((cos(Pi*n/k))^2). And floor((cos(Pi*n/k))^2) = floor(1/4 * e^(-(2*i*Pi*n)/k) + 1/4 * e^((2*i*Pi*n)/k) + 1/2). - Eric Desbiaux, Mar 09 2010, corrected Apr 16 2011
a(n) = 1 + Sum_{k=1..n} (floor(2^n/(2^k-1)) mod 2) for every n. - Fabio Civolani (civox(AT)tiscali.it), Mar 12 2010
From Vladimir Shevelev, May 22 2010: (Start)
(Sum_{d|n} a(d))^2 = Sum_{d|n} a(d)^3 (J. Liouville).
Sum_{d|n} A008836(d)*a(d)^2 = A008836(n)*Sum_{d|n} a(d). (End)
a(n) = sigma_0(n) = 1 + Sum_{m>=2} Sum_{r>=1} (1/m^(r+1))*Sum_{j=1..m-1} Sum_{k=0..m^(r+1)-1} e^(2*k*Pi*i*(n+(m-j)*m^r)/m^(r+1)). - A. Neves, Oct 04 2010
a(n) = 2*A038548(n) - A010052(n). - Reinhard Zumkeller, Mar 08 2013
Sum_{n>=1} a(n)*q^n = (log(1-q) + psi_q(1)) / log(q), where psi_q(z) is the q-digamma function. - Vladimir Reshetnikov, Apr 23 2013
a(n) = Product_{k = 1..A001221(n)} (A124010(n,k) + 1). - Reinhard Zumkeller, Jul 12 2013
a(n) = Sum_{k=1..n} A238133(k)*A000041(n-k). - Mircea Merca, Feb 18 2013
G.f.: Sum_{k>=1} Sum_{j>=1} x^(j*k). - Mats Granvik, Jun 15 2013
The formula above is obtained by expanding the Lambert series Sum_{k>=1} x^k/(1-x^k). - Joerg Arndt, Mar 12 2014
G.f.: Sum_{n>=1} Sum_{d|n} ( -log(1 - x^(n/d)) )^d / d!. - Paul D. Hanna, Aug 21 2014
2*Pi*a(n) = Sum_{m=1..n} Integral_{x=0..2*Pi} r^(m-n)( cos((m-n)*x)-r^m cos(n*x) )/( 1+r^(2*m)-2r^m cos(m*x) )dx, 0 < r < 1 a free parameter. This formula is obtained as the sum of the residues of the Lambert series Sum_{k>=1} x^k/(1-x^k). - Seiichi Kirikami, Oct 22 2015
a(n) = A091220(A091202(n)) = A106737(A156552(n)). - Antti Karttunen, circa 2004 & Mar 06 2017
a(n) = A034296(n) - A237665(n+1) [Wang, Fokkink, Fokkink]. - George Beck, May 06 2017
G.f.: 2*x/(1-x) - Sum_{k>0} x^k*(1-2*x^k)/(1-x^k). - Mamuka Jibladze, Aug 29 2018
a(n) = Sum_{k=1..n} 1/phi(n / gcd(n, k)). - Daniel Suteu, Nov 05 2018
a(k*n) = a(n)*(f(k,n)+2)/(f(k,n)+1), where f(k,n) is the exponent of the highest power of k dividing n and k is prime. - Gary Detlefs, Feb 08 2019
a(n) = 2*log(p(n))/log(n), n > 1, where p(n)= the product of the factors of n = A007955(n). - Gary Detlefs, Feb 15 2019
a(n) = (1/n) * Sum_{k=1..n} sigma(gcd(n,k)), where sigma(n) = sum of divisors of n. - Orges Leka, May 09 2019
a(n) = A001227(n)*(A007814(n) + 1) = A001227(n)*A001511(n). - Ivan N. Ianakiev, Nov 14 2019
From Richard L. Ollerton, May 11 2021: (Start)
a(n) = A038040(n) / n = (1/n)*Sum_{d|n} phi(d)*sigma(n/d), where phi = A000010 and sigma = A000203.
a(n) = (1/n)*Sum_{k=1..n} phi(gcd(n,k))*sigma(n/gcd(n,k))/phi(n/gcd(n,k)). (End)
From Ridouane Oudra, Nov 12 2021: (Start)
a(n) = Sum_{j=1..n} Sum_{k=1..j} (1/j)*cos(2*k*n*Pi/j);
a(n) = Sum_{j=1..n} Sum_{k=1..j} (1/j)*e^(2*k*n*Pi*i/j), where i^2=-1. (End)

Extensions

Incorrect formula deleted by Ridouane Oudra, Oct 28 2021

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

Original entry on oeis.org

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

Views

Author

Keywords

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. Adams-Watters, 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
For n > 1: A020652(a(n)) = 1 and A038567(a(n)) = n; for n > 0: A214803(a(n)) = 1. - Reinhard Zumkeller, Jul 29 2012
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
From Roger Ford, Jan 16 2016: (Start)
For n >= 1: a(n) is the number of perfect arched semi-meander 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 semi-meander 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
2013 IMO Problem 6 shows that a(n) is the number of ways to arrange the numbers 0, 1, ..., n on a circle such that for any numbers 0 <= a < b < c < d <= n, the chord joining a and d does not intersect with the chord intersecting b and c, with rotation counted as same. - Yifan Xie, Aug 26 2025

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.

Crossrefs

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(n) = A000217(n) - A063985(n) = A018805(n) - A015614(n). - Reinhard Zumkeller, Jan 21 2013
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

A065473 Decimal expansion of the strongly carefree constant: Product_{p prime} (1 - (3*p-2)/(p^3)).

Original entry on oeis.org

2, 8, 6, 7, 4, 7, 4, 2, 8, 4, 3, 4, 4, 7, 8, 7, 3, 4, 1, 0, 7, 8, 9, 2, 7, 1, 2, 7, 8, 9, 8, 3, 8, 4, 4, 6, 4, 3, 4, 3, 3, 1, 8, 4, 4, 0, 9, 7, 0, 5, 6, 9, 9, 5, 6, 4, 1, 4, 7, 7, 8, 5, 9, 3, 3, 6, 6, 5, 2, 2, 4, 3, 1, 3, 1, 9, 4, 3, 2, 5, 8, 2, 4, 8, 9, 1, 2, 6, 8, 2, 5, 5, 3, 7, 4, 2, 3, 7, 4, 6, 8, 5, 3, 6, 4, 7
Offset: 0

Views

Author

N. J. A. Sloane, Nov 19 2001

Keywords

Comments

Also decimal expansion of the probability that an integer triple (x, y, z) is pairwise coprime. - Charles R Greathouse IV, Nov 14 2011
The probability that 2 numbers chosen at random are coprime, and both squarefree (Delange, 1969). - Amiram Eldar, Aug 04 2020

Examples

			0.2867474284344787341078927127898384...
		

References

  • Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, 2003, Section 1.6, p. 41.
  • Gerald Tenenbaum, Introduction to Analytic and Probabilistic Number Theory, 3rd edition, American Mathematical Society, 2015, page 59, exercise 55 and 56.

Crossrefs

Programs

  • Mathematica
    digits = 100; NSum[-(2+(-2)^n)*PrimeZetaP[n]/n, {n, 2, Infinity}, NSumTerms -> 2 digits, WorkingPrecision -> 2 digits, Method -> "AlternatingSigns"] // Exp // RealDigits[#, 10, digits]& // First (* Jean-François Alcover, Apr 11 2016 *)
  • PARI
    prodeulerrat(1 - (3*p-2)/(p^3)) \\ Amiram Eldar, Mar 17 2021

Formula

Equals Prod_{p prime} (1 - 1/p)^2*(1 + 2/p). - Michel Marcus, Apr 16 2016
The constant c in Sum_{k<=x} mu(k)^2 * 2^omega(k) = c * x * log(x) + O(x), where mu is A008683 and omega is A001221, and in Sum_{k<=x} 3^omega(k) = (1/2) * c * x * log(x)^2 + O(x*log(x)) (see Tenenbaum, 2015). - Amiram Eldar, May 24 2020
Equals A065472 * A227929 = A065472 / A098198. - Amiram Eldar, Aug 04 2020

Extensions

Name corrected by Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 03 2003
More digits from Vaclav Kotesovec, Dec 19 2019

A152649 Decimal expansion of Pi^4/72.

Original entry on oeis.org

1, 3, 5, 2, 9, 0, 4, 0, 4, 2, 1, 3, 8, 9, 2, 2, 7, 3, 9, 3, 9, 5, 0, 0, 4, 6, 2, 0, 6, 7, 6, 4, 5, 9, 8, 7, 8, 4, 6, 8, 4, 3, 8, 6, 8, 9, 8, 9, 8, 4, 0, 8, 6, 3, 4, 6, 0, 3, 7, 2, 0, 2, 6, 9, 3, 0, 5, 1, 5, 0, 7, 7, 0, 2, 3, 3, 7, 1, 1, 0, 5, 8, 1, 9, 6, 1, 3, 7, 0, 4, 4, 9, 2, 7, 1, 2, 4, 8, 9, 6, 5, 4, 1, 2, 3
Offset: 1

Views

Author

R. J. Mathar, Dec 10 2008

Keywords

Comments

A division by 2 is missing in Mezo's penultimate formula on page 4.

Examples

			Equals 1.352904042138922739395004620676459878468438689898408634603...
		

Crossrefs

Programs

Formula

Equals A098198/2 = A092425/72.
Equals Sum_{j >= 1} H(j)/j^3 where H(j) = A001008(j)/A002805(j).
Equals 20*Sum_{j >= 1} (2*j)^(-4) (see Gradsteyn and Ryzhik in Links section). - A.H.M. Smeets, Sep 18 2018
Equals Sum_{k>=1} A048272(k)/k^2. - Amiram Eldar, Jan 25 2024

A368472 Product of exponents of prime factorization of the exponentially odd numbers.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1
Offset: 1

Views

Author

Amiram Eldar, Dec 26 2023

Keywords

Comments

The odd terms of A005361.
The first position of 2*k-1, for k = 1, 2, ..., is 1, 7, 24, 91, 154, 1444, 5777, 610, 92349, ..., which is the position of A085629(2*k-1) in A268335.

Crossrefs

Programs

  • Mathematica
    f[n_] := Module[{p = Times @@ FactorInteger[n][[;; , 2]]}, If[OddQ[p], p, Nothing]]; Array[f, 150]
  • PARI
    lista(kmax) = {my(p); for(k = 1, kmax, p = vecprod(factor(k)[, 2]); if(p%2, print1(p, ", ")));}

Formula

a(n) = A005361(A268335(n)).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = (zeta(2)^2/d) * Product_{p prime} (1 - 3/p^2 + 3/p^3 - 1/p^5) = 1.38446562720473484463..., where d = A065463 is the asymptotic density of the exponentially odd numbers.

A333972 Decimal expansion of Pi^6/540 = zeta(2) * zeta(4).

Original entry on oeis.org

1, 7, 8, 0, 3, 5, 0, 3, 5, 8, 4, 7, 2, 7, 8, 5, 9, 9, 4, 5, 0, 0, 4, 0, 6, 3, 7, 7, 1, 3, 4, 1, 1, 0, 9, 2, 3, 8, 2, 8, 1, 8, 0, 6, 0, 7, 5, 5, 7, 4, 9, 3, 7, 3, 3, 2, 2, 4, 2, 1, 5, 1, 6, 2, 0, 0, 7, 5, 8, 1, 3, 2, 0, 0, 7, 8, 4, 2, 6, 3, 2, 1, 2, 9, 4, 8, 5, 4, 4, 6, 1, 3, 9, 2, 4
Offset: 1

Views

Author

Bernard Schott, Sep 29 2020

Keywords

Comments

Compare 1st formula with Sum_{m>0, q>0} 1/(m^2*q^2) = Pi^4/36 = (zeta(2))^2 = A098198.

Examples

			1.78035035847278599450040637713411092382818060755749373322421516...
		

References

  • Jean-Marie Monier, Analyse, Exercices corrigés, 2ème année MP, Dunod, 1997, Exercice 3.22, p. 275.

Crossrefs

Programs

  • Maple
    evalf(Pi^6/540,120);
  • Mathematica
    RealDigits[Pi^6/540, 10, 100][[1]] (* Amiram Eldar, Sep 29 2020 *)
  • PARI
    Pi^6/540 \\ Michel Marcus, Sep 30 2020

Formula

Equals Sum_{m>0, q>0, m | q} 1/(m^2*q^2).
Equals A013661 * A068447.
Equals Sum_{k>=1} sigma_2(k)/k^4. - Amiram Eldar, Sep 30 2020
Equals Sum_{k>=1} A046951(k)/k^2. - Amiram Eldar, Jan 25 2024

A371415 Dedekind psi function applied to the cubefull exponentially odd numbers (A335988).

Original entry on oeis.org

1, 12, 36, 48, 150, 192, 432, 324, 392, 768, 1728, 1800, 1452, 3888, 3072, 2916, 2366, 4704, 3750, 5400, 6912, 7200, 5202, 7220, 15552, 12288, 14112, 17424, 18816, 12696, 27648, 28800, 19208, 34992, 28392, 26244, 25230, 45000, 64800, 30752, 48600, 62208, 49152
Offset: 1

Views

Author

Amiram Eldar, Mar 22 2024

Keywords

Crossrefs

Similar sequences: A323332, A371413, A371414.

Programs

  • Mathematica
    psi[n_] := n * Times @@ (1 + 1/FactorInteger[n][[;; , 1]]); psi[1] = 1; Join[{1}, psi /@ Select[Range[40000], AllTrue[Last /@ FactorInteger[#], #1 > 1 && OddQ[#1] &] &]]
  • PARI
    dedpsi(f) = prod(i = 1, #f~, (f[i, 1] + 1) * f[i, 1]^(f[i, 2]-1));
    lista(max) = {my(f, ans); print1(1, ", "); for(k = 2, max, f = factor(k); ans = 1; for (i = 1, #f~, if (f[i, 2] == 1 || !(f[i, 2] % 2), ans = 0; break)); if(ans, print1(dedpsi(f), ", ")));}

Formula

a(n) = A001615(A335988(n)).
Sum_{n>=1} 1/a(n) = (Pi^4/36) * Product_{p prime} (1 - (2*p-1)/p^3) = A098198 * A065464 = 1.158760974549073218921828... .

A183030 Decimal expansion of Sum_{j>=1} tau(j)/j^3 = zeta(3)^2.

Original entry on oeis.org

1, 4, 4, 4, 9, 4, 0, 7, 9, 8, 4, 3, 3, 6, 3, 4, 2, 3, 3, 9, 1, 3, 6, 8, 5, 0, 7, 8, 8, 0, 6, 9, 8, 7, 8, 2, 7, 1, 8, 3, 7, 3, 5, 4, 0, 5, 7, 6, 3, 8, 8, 8, 6, 7, 4, 1, 3, 1, 4, 3, 4, 1, 6, 1, 8, 9, 8, 5, 8, 3, 8, 5, 6, 1, 3, 1, 3, 5, 4, 1, 0, 1, 9, 6, 6, 1, 9
Offset: 1

Views

Author

R. J. Mathar, Dec 18 2010

Keywords

Comments

This is the zeta-function Sum_{j>=1} A000005(j)/j^s evaluated at s=3. At s=2 we find A098198, at s=4 A183031.
Since tau(n)/n^3 is a multiplicative function, one finds an Euler product for the sum, which is expanded with an Euler transformation to a product of Riemann zeta functions as in A175639 for numerical evaluation.

Examples

			1.4449407984336342339136.. = 1 +2/2^3 +2/3^3 +3/4^3 +2/5^3 +4/6^3 +2/7^3+...
		

Crossrefs

Programs

Formula

Equals the Euler product Product_{p= A000040} (1+ (2*p^s-1)/(p^s-1)^2) at s=3, or the square of A002117.

A211780 a(n) = Sum_{d|n, dA000005 is the number of divisors.

Original entry on oeis.org

0, 2, 2, 7, 2, 14, 2, 18, 9, 18, 2, 43, 2, 22, 20, 41, 2, 54, 2, 57, 24, 30, 2, 106, 13, 34, 31, 71, 2, 110, 2, 88, 32, 42, 28, 162, 2, 46, 36, 142, 2, 138, 2, 99, 81, 54, 2, 237, 17, 102, 44, 113, 2, 178, 36, 178, 48, 66, 2, 325, 2, 70, 99, 183, 40, 194, 2
Offset: 1

Views

Author

Jaroslav Krizek, Apr 20 2012

Keywords

Comments

Numbers n such that n divides a(n) are given in A068978.

Examples

			For n = 12: Sum_{d|n, d<n} d * tau(n / d) = 1*6 + 2*4 + 3*3 + 4*2 + 6*2 = 43.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[d*DivisorSigma[0, n/d], {d, Most[Divisors[n]]}], {n, 100}] (* T. D. Noe, Apr 27 2012 *)
  • PARI
    A211780(n) = sumdiv(n, d, sigma(d))-n; \\ Antti Karttunen, Nov 13 2017
    
  • Python
    A211780=lambda n:sum(sigma(d) for d in divisors(n, generator=True))-n
    from sympy import divisor_sigma as sigma, divisors # M. F. Hasler, Jun 03 2024

Formula

a(n) = A007429(n) - n = A211779(n) + A000203(n) - n .
a(n) = (Sum_{d|n} A000203(d)) - n. - Antti Karttunen, Nov 13 2017
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Pi^4/36 - 1 = 1.705808... . - Amiram Eldar, Jun 06 2024

Extensions

Name edited by M. F. Hasler, Jun 03 2024

A368169 The number of divisors of the largest unitary divisor of n that is a cubefull exponentially odd number (A368167).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 4, 1, 1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Amiram Eldar, Dec 14 2023

Keywords

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := If[e == 1 || EvenQ[e], 1, e+1]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~, if(f[i, 2] == 1 || !(f[i, 2]%2), 1, f[i, 2]+1));}

Formula

Multiplicative with a(p^e) = e+1 if e is odd that is larger than 1, and 1 otherwise.
a(n) = A000005(A368167(n)).
a(n) >= 1, with equality if and only if n is in A335275.
a(n) <= A000005(n), with equality if and only if n is in A335988.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = zeta(2)^2 * Product_{p prime} (1 - 2/p^2 + 3/p^3 - 2/p^4 - 1/p^5 + 1/p^6) = 1.47140789970892803631... .
Showing 1-10 of 21 results. Next