%I #15 Jun 04 2023 14:57:20
%S 1,4,12,24,50,72,126,176,252,320,462,552,754,896,1080,1280,1632,1836,
%T 2280,2560,2940,3300,3956,4320,5000,5512,6210,6776,7830,8340,9548,
%U 10368,11352,12240,13440,14256,15984,17100,18486,19600,21730,22764,25112
%N a(n) = n*A002088(n).
%C Also number of reduced fractions with denominators <= n and values between 1/n and n (inclusive). [_Reinhard Zumkeller_, Jan 15 2009]
%H Harvey P. Dale, <a href="/A143270/b143270.txt">Table of n, a(n) for n = 1..1000</a>
%F a(n) = n*A002088(n), where A002088(n) = partial sums of phi(n).
%F Equals row sums of triangle A143269.
%F a(n) = SUM(SUM(0^(GCD(i,j)-1): 1<=j<=i*n): 1<=i<=n). [_Reinhard Zumkeller_, Jan 15 2009]
%e a(4) = 24 = n*A002088(n) = 4*6.
%e a(4) = 24 = sum of row 4 terms of triangle A143269: (4 + 4 + 8 + 8).
%e a(3) = #{1/3,1/2,2/3,1,4/3,3/2,5/3,2,7/3,5/2,8/3,3} = 12. [_Reinhard Zumkeller_, Jan 15 2009]
%t Module[{nn=50,ps},ps=Accumulate[EulerPhi[Range[nn]]];Times@@@Thread[{Range[nn],ps}]] (* _Harvey P. Dale_, Jun 04 2023 *)
%o (Python)
%o from functools import lru_cache
%o @lru_cache(maxsize=None)
%o def A143270(n): # based on second formula in A018805
%o if n == 0:
%o return 0
%o c, j = 0, 2
%o k1 = n//j
%o while k1 > 1:
%o j2 = n//k1 + 1
%o c += (j2-j)*(2*A143270(k1)//k1-1)
%o j, k1 = j2, n//j2
%o return n*(n*(n-1)-c+j)//2 # _Chai Wah Wu_, Mar 25 2021
%Y Cf. A000010, A002088, A143269.
%K nonn
%O 1,2
%A _Gary W. Adamson_, Aug 03 2008
%E More terms from _Reinhard Zumkeller_, Jan 15 2009