login
A278049
a(n) = 3*(Sum_{k=1..n} phi(k)) - 1, where phi = A000010.
1
2, 5, 11, 17, 29, 35, 53, 65, 83, 95, 125, 137, 173, 191, 215, 239, 287, 305, 359, 383, 419, 449, 515, 539, 599, 635, 689, 725, 809, 833, 923, 971, 1031, 1079, 1151, 1187, 1295, 1349, 1421, 1469, 1589, 1625, 1751, 1811, 1883, 1949, 2087, 2135, 2261, 2321, 2417, 2489, 2645, 2699, 2819, 2891, 2999
OFFSET
1,1
LINKS
J. Lehner and M. Newman, Sums involving Farey fractions, Acta Arithmetica 15.2 (1969): 181-187. See Eq. (19).
FORMULA
G.f.: (1/(1 - x)) * (-x + 3 * Sum_{k>=1} mu(k) * x^k / (1 - x^k)^2). - Ilya Gutkovskiy, Feb 14 2020
MAPLE
with(numtheory);
f:=n->3*add(phi(r), r=1..n)-1;
[seq(f(r), r=1..50)];
MATHEMATICA
Table[3 Sum[EulerPhi@ k, {k, n}] - 1, {n, 57}] (* Michael De Vlieger, Dec 16 2016 *)
PROG
(Python)
from functools import lru_cache
@lru_cache(maxsize=None)
def A278049(n): # based on second formula in A018805
if n == 0:
return -1
c, j = 0, 2
k1 = n//j
while k1 > 1:
j2 = n//k1 + 1
c += (j2-j)*(2*A278049(k1)-1)//3
j, k1 = j2, n//j2
return 3*(n*(n-1)-c+j)//2 - 1 # Chai Wah Wu, Mar 25 2021
CROSSREFS
Cf. m*(Sum_{k=1..n} phi(k)) - 1: A015614 (m=1), A018805 (m=2), this sequence (m=3).
Sequence in context: A153222 A023222 A289250 * A007491 A124850 A156850
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Nov 22 2016
STATUS
approved