login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A222548 a(n) = Sum_{k=1..n} floor(n/k)^2. 19
1, 5, 11, 22, 32, 52, 66, 92, 115, 147, 169, 219, 245, 289, 333, 390, 424, 496, 534, 612, 672, 740, 786, 898, 957, 1037, 1113, 1219, 1277, 1413, 1475, 1595, 1687, 1791, 1883, 2056, 2130, 2246, 2354, 2526, 2608, 2792, 2878, 3040, 3190, 3330, 3424, 3662, 3773 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
a(n) is the number of common divisors of integers 1<=i,j<=n over all ordered pairs (i,j). - Geoffrey Critzer, Jan 15 2015
REFERENCES
J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 98.
LINKS
FORMULA
a(n) = zeta(2)*n^2 + O(n log n).
a(n) = 2*A024916(n) - A006218(n). - Vaclav Kotesovec, Sep 02 2018
G.f.: (1/(1 - x)) * Sum_{k>=1} (2*k - 1) * x^k/(1 - x^k). - Ilya Gutkovskiy, Jul 16 2019
a(n) = Sum_{d=1..n} (2*d-1)*floor(n/d). [Uspensky and Heaslet] - Michael Somos, Feb 16 2020
a(n) = Sum_{k=1..n} Sum_{d|k} floor(n/d). - Ridouane Oudra, Jul 16 2020
a(n) = Sum_{i=1..n} Sum_{j=1..n} tau(gcd(i,j)). - Ridouane Oudra, Nov 23 2021
MATHEMATICA
Table[Sum[Floor[n/k]^2, {k, n}], {n, 50}] (* T. D. Noe, Feb 26 2013 *)
Table[nn = n; Total[Level[Table[Table[DivisorSigma[0, GCD[i, j]], {i, 1, nn}], {j, 1, nn}], {2}]], {n, 1, 49}] (* Geoffrey Critzer, Jan 15 2015 *)
Table[Sum[2*DivisorSigma[1, k] - DivisorSigma[0, k], {k, 1, n}], {n, 1, 50}] (* Vaclav Kotesovec, Sep 02 2018 *)
PROG
(PARI) a(n)=sum(k=1, n, (n\k)^2)
(Magma) [&+[Floor(n/k)^2:k in [1..n] ]: n in [1..40]]; // Marius A. Burtea, Jul 16 2019
(Python)
from math import isqrt
def A222548(n): return -(s:=isqrt(n))**3 + sum((q:=n//k)*((k<<1)+q-1) for k in range(1, s+1)) # Chai Wah Wu, Oct 21 2023
CROSSREFS
Similar sequences for Sum_{k=1..n} floor(n/k)^m: A006218 (m=1), this sequence (m=2), A318742 (m=3), A318743 (m=4), A318744 (m=5).
Sequence in context: A296968 A184552 A069097 * A024921 A189978 A192761
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Feb 24 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 07:16 EDT 2024. Contains 371905 sequences. (Running on oeis4.)