%I #42 Nov 25 2023 08:02:02
%S 0,1,0,1,1,1,0,2,0,2,1,1,0,2,1,2,1,1,0,3,0,2,1,2,1,2,0,2,1,2,0,3,1,2,
%T 2,1,0,2,0,4,1,2,0,3,1,2,1,2,0,3,1,2,1,1,2,4,0,2,1,3,0,2,0,3,2,2,0,3,
%U 1,4,1,2,0,2,1,2,2,2,0,5,0,2,1,2,2,2,1,4,1,2,0,3,0,2,2,3,0,3,1,4,1,2,0,4,2
%N Expansion of Sum_{n>=0} x^(3n+2)/(1-x^(3n+2)).
%C a(n) is the number of positive divisors of n of the form 3k+2. If r(n) denotes the number of representations of n by the quadratic form j^2+i*j+i^2, then r(n)= 6 *(A001817(n)-a(n)). - _Benoit Cloitre_, Jun 24 2002
%D Bruce C. Berndt,"On a certain theta-function in a letter of Ramanujan from Fitzroy House", Ganita 43 (1992),33-43.
%H Nick Hobson, <a href="/A001822/b001822.txt">Table of n, a(n) for n = 1..10000</a>
%H P. G. Dirichlet, <a href="http://dx.doi.org/10.1515/crll.1840.21.1">Recherches sur diverses applications de l'analyse infinitésimale à la théorie des nombres</a>, J. Reine Angew. Math. 21 (1840), 1-12.
%H Michael Gilleland, <a href="/selfsimilar.html">Some Self-Similar Integer Sequences</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 Moebius transform is period 3 sequence [0, 1, 0, ...]. - _Michael Somos_, Sep 20 2005
%F G.f.: Sum_{k>0} x^(3k-1)/(1-x^(3k-1)) = Sum_{k>0} x^(2k)/(1-x^(3k)). - _Michael Somos_, Sep 20 2005
%F a(n) = (A035191(n) - A002324(n)) / 2. - _Reinhard Zumkeller_, Nov 26 2011
%F a(n) + A001817(n) + A000005(n/3) = A000005(n), where A000005(.)=0 if the argument is not an integer. - _R. J. Mathar_, Sep 25 2017
%F Sum_{k=1..n} a(k) = 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
%p A001822 := proc(n)
%p local a,d ;
%p a := 0 ;
%p for d in numtheory[divisors](n) do
%p if modp(d,3) = 2 then
%p a := a+1 ;
%p end if ;
%p end do:
%p a ;
%p end proc:
%p seq(A001822(n),n=1..100) ; # _R. J. Mathar_, Sep 25 2017
%t a[n_] := DivisorSum[n, Boole[Mod[#, 3] == 2]&]; Array[a, 100] (* _Jean-François Alcover_, Dec 01 2015 *)
%o (PARI) a(n)=if(n<1, 0, sumdiv(n,d, d%3==2))
%o (Haskell)
%o a001822 n = length [d | d <- [2,5..n], mod n d == 0]
%o -- _Reinhard Zumkeller_, Nov 26 2011
%Y Cf. A000005, A001620, A001817, A002324, A035191, A256843.
%K nonn,easy
%O 1,8
%A _N. J. A. Sloane_