OFFSET
0,5
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
R. A. Smith and M. V. Subbarao, The average number of divisors in an arithmetic progression, Canadian Mathematical Bulletin, Vol. 24, No. 1 (1981), pp. 37-41.
FORMULA
G.f.: Sum_{k>=0} x^(3*k+2)/((1-x^(3*k+2))*(1-x)). - Robert Israel, Feb 28 2017
a(n) = n*log(n)/3 + c*n + O(n^(1/3)*log(n)), where c = gamma(2,3) - (1 - gamma)/3 = A256843 - (1 - A001620)/3 = -0.0677207... (Smith and Subbarao, 1981). - Amiram Eldar, Nov 25 2023
MAPLE
N:= 100: # to get a(0)..a(N)
A001822:= Vector(N+1):
for m from 2 to N by 3 do
L:= [seq(i, i=m+1..N+1, m)]:
od:
ListTools:-PartialSums(convert(A001822, list)); # Robert Israel, Feb 28 2017
MATHEMATICA
Table[Sum[Floor[n/(3k+2)], {k, 0, n}], {n, 0, 80}] (* Harvey P. Dale, Jun 22 2013 *)
d[n_] := DivisorSum[n, 1 &, Mod[#, 3] == 2 &]; d[0] = 0; Accumulate@Array[d, 100, 0] (* Amiram Eldar, Nov 25 2023 *)
PROG
(PARI) a(n)=sum(k=0, n\3, (n\(3*k+2)))
(Maxima) A218443[n]:=sum(floor(n/(3*k+2)), k, 0, n)$
makelist(A218443[n], n, 0, 80); /* Martin Ettl, Oct 29 2012 */
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Benoit Cloitre, Oct 28 2012
STATUS
approved