%I #21 Nov 25 2023 08:03:08
%S 0,1,2,3,5,6,7,9,11,12,14,15,17,19,21,22,25,26,27,29,32,34,36,37,39,
%T 41,43,44,48,49,51,53,56,57,59,61,63,65,67,69,73,74,76,78,81,82,84,85,
%U 88,91,94,95,99,100,101,103,107,109,111,112,115,117,119,121,125,127,129,131,134,135,139,140,142,144,146,148,152
%N a(n) = Sum_{k=0..n} floor(n/(3*k + 1)).
%H Amiram Eldar, <a href="/A218442/b218442.txt">Table of n, a(n) for n = 0..10000</a>
%H R. A. Smith and M. V. Subbarao, <a href="https://doi.org/10.4153/CMB-1981-005-3">The average number of divisors in an arithmetic progression</a>, Canadian Mathematical Bulletin, Vol. 24, No. 1 (1981), pp. 37-41.
%F a(n) = n*log(n)/3 + c*n + O(n^(1/3)*log(n)), where c = gamma(1,3) - (1 - gamma)/3 = A256425 - (1 - A001620)/3 = 0.536879... (Smith and Subbarao, 1981). - _Amiram Eldar_, Nov 25 2023
%t d[n_] := DivisorSum[n, 1 &, Mod[#, 3] == 1 &]; d[0] = 0; Accumulate@Array[d, 100, 0] (* _Amiram Eldar_, Nov 25 2023 *)
%o (PARI) a(n)=sum(k=0,n\3,(n\(3*k+1)))
%o (Maxima) A218442[n]:=sum(floor(n/(3*k+1)),k,0,n)$
%o makelist(A218442[n],n,0,80); /* _Martin Ettl_, Oct 29 2012 */
%Y Partial sums of A001817.
%Y Cf. A001620, A218443, A256425.
%K nonn,easy
%O 0,3
%A _Benoit Cloitre_, Oct 28 2012