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.

A057661 a(n) = Sum_{k=1..n} lcm(n,k)/n.

This page as a plain text file.
%I A057661 #94 Jul 02 2025 16:02:00
%S A057661 1,2,4,6,11,11,22,22,31,32,56,39,79,65,74,86,137,92,172,116,151,167,
%T A057661 254,151,261,236,274,237,407,221,466,342,389,410,452,336,667,515,550,
%U A057661 452,821,452,904,611,641,761,1082,599,1051,782,956,864,1379,821,1166
%N A057661 a(n) = Sum_{k=1..n} lcm(n,k)/n.
%C A057661 Sum of numerators of n-th order Farey series (cf. A006842). - _Benoit Cloitre_, Oct 28 2002
%C A057661 Equals row sums of triangle A143613. - _Gary W. Adamson_, Aug 27 2008
%C A057661 Equals row sums of triangle A159936. - _Gary W. Adamson_, Apr 26 2009
%C A057661 Also row sums of triangle A164306. - _Reinhard Zumkeller_, Aug 12 2009
%D A057661 H. W. Gould and Temba Shonhiwa, Functions of GCD's and LCM's, Indian J. Math. (Allahabad), 39 (1997), 11-35.
%D A057661 H. W. Gould and Temba Shonhiwa, A generalization of Cesaro's function and other results, Indian J. Math. (Allahabad), 39 (1997), 183-194.
%H A057661 T. D. Noe, <a href="/A057661/b057661.txt">Table of n, a(n) for n = 1..1000</a>
%H A057661 Zachary Franco, <a href="https://doi.org/10.1080/00029890.2019.1583529">Problem 12114</a>, The American Mathematical Monthly, Vol. 126, No. 5 (2019), p. 469; <a href="https://doi.org/10.1080/00029890.2021.1840171">A Dirichlet Series with Reduced Numerators</a>, Solution to Problem 12114 by Tamas Wiandt, ibid., Vol. 128, No. 1 (2021), pp. 91-92.
%H A057661 <a href="/index/Lc#lcm">Index entries for sequences related to lcm's</a>.
%F A057661 a(n) = (1+A057660(n))/2.
%F A057661 a(n) = A051193(n)/n.
%F A057661 a(n) = Sum_{d|n} psi(d), where psi(m) = is the sum of totatives of m (A023896). - _Jaroslav Krizek_, Dec 28 2016
%F A057661 a(n) = Sum_{i=1..n} denominator(n/i). - _Wesley Ivan Hurt_, Feb 26 2017
%F A057661 G.f.: x/(2*(1 - x)) + (1/2)*Sum_{k>=1} k*phi(k)*x^k/(1 - x^k), where phi() is the Euler totient function (A000010). - _Ilya Gutkovskiy_, Aug 31 2017
%F A057661 If p is prime, then a(p) = T(p-1) + 1 = p(p-1)/2 + 1, where T(n) = n(n+1)/2 is the n-th triangular number (A000217). - _David Terr_, Feb 10 2019
%F A057661 Sum_{k=1..n} a(k) ~ zeta(3) * n^3 / Pi^2. - _Vaclav Kotesovec_, May 29 2021
%F A057661 Dirichlet g.f.: zeta(s)*(1 + zeta(s-2)/zeta(s-1))/2 (Franco, 2019). - _Amiram Eldar_, Mar 26 2022
%t A057661 Table[Total[Numerator[Range[n]/n]], {n, 55}] (* _Alonso del Arte_, Oct 07 2011 *)
%t A057661 f[p_, e_] := (p^(2*e + 1) + 1)/(p + 1); a[n_] := (1 + Times @@ f @@@ FactorInteger[n])/2; Array[a, 100] (* _Amiram Eldar_, Apr 26 2023 *)
%o A057661 (Haskell)
%o A057661 a057661 n = a051193 n `div` n  -- _Reinhard Zumkeller_, Jun 10 2015
%o A057661 (Magma) [&+[&+[h: h in [1..d] | GCD(h,d) eq 1]: d in Divisors(n)]: n in [1..100]]; // _Jaroslav Krizek_, Dec 28 2016
%o A057661 (PARI) a(n)=sum(k=1,n,lcm(n,k))/n \\ _Charles R Greathouse IV_, Feb 07 2017
%o A057661 (Python)
%o A057661 from math import lcm
%o A057661 def A057661(n): return sum(lcm(n,k)//n for k in range(1,n+1)) # _Chai Wah Wu_, Aug 24 2023
%o A057661 (Python)
%o A057661 from math import prod
%o A057661 from sympy import factorint
%o A057661 def A057661(n): return 1+prod((p**((e<<1)+1)+1)//(p+1) for p,e in factorint(n).items())>>1 # _Chai Wah Wu_, Aug 05 2024
%Y A057661 Cf. A000010, A000217, A006842, A018804, A023896, A051193, A057660, A143613, A159936, A164306.
%Y A057661 See A341316 for another version.
%K A057661 easy,nice,nonn
%O A057661 1,2
%A A057661 _Henry Gould_, Oct 15 2000
%E A057661 More terms from _James Sellers_, Oct 16 2000