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.

A278049 a(n) = 3*(Sum_{k=1..n} phi(k)) - 1, where phi = A000010.

This page as a plain text file.
%I A278049 #22 Mar 26 2021 08:42:28
%S A278049 2,5,11,17,29,35,53,65,83,95,125,137,173,191,215,239,287,305,359,383,
%T A278049 419,449,515,539,599,635,689,725,809,833,923,971,1031,1079,1151,1187,
%U A278049 1295,1349,1421,1469,1589,1625,1751,1811,1883,1949,2087,2135,2261,2321,2417,2489,2645,2699,2819,2891,2999
%N A278049 a(n) = 3*(Sum_{k=1..n} phi(k)) - 1, where phi = A000010.
%H A278049 Seiichi Manyama, <a href="/A278049/b278049.txt">Table of n, a(n) for n = 1..10000</a>
%H A278049 J. Lehner and M. Newman, <a href="http://matwbn.icm.edu.pl/ksiazki/aa/aa15/aa15114.pdf">Sums involving Farey fractions</a>, Acta Arithmetica 15.2 (1969): 181-187. See Eq. (19).
%F A278049 G.f.: (1/(1 - x)) * (-x + 3 * Sum_{k>=1} mu(k) * x^k / (1 - x^k)^2). - _Ilya Gutkovskiy_, Feb 14 2020
%p A278049 with(numtheory);
%p A278049 f:=n->3*add(phi(r),r=1..n)-1;
%p A278049 [seq(f(r),r=1..50)];
%t A278049 Table[3 Sum[EulerPhi@ k, {k, n}] - 1, {n, 57}] (* _Michael De Vlieger_, Dec 16 2016 *)
%o A278049 (Python)
%o A278049 from functools import lru_cache
%o A278049 @lru_cache(maxsize=None)
%o A278049 def A278049(n): # based on second formula in A018805
%o A278049     if n == 0:
%o A278049         return -1
%o A278049     c, j = 0, 2
%o A278049     k1 = n//j
%o A278049     while k1 > 1:
%o A278049         j2 = n//k1 + 1
%o A278049         c += (j2-j)*(2*A278049(k1)-1)//3
%o A278049         j, k1 = j2, n//j2
%o A278049     return 3*(n*(n-1)-c+j)//2 - 1 # _Chai Wah Wu_, Mar 25 2021
%Y A278049 Cf. A000010, A002088.
%Y A278049 Cf. m*(Sum_{k=1..n} phi(k)) - 1: A015614 (m=1), A018805 (m=2), this sequence (m=3).
%K A278049 nonn
%O A278049 1,1
%A A278049 _N. J. A. Sloane_, Nov 22 2016