login
The number of divisors d of n of the form d == 5 (mod 8).
10

%I #23 Nov 25 2023 04:37:19

%S 0,0,0,0,1,0,0,0,0,1,0,0,1,0,1,0,0,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,0,0,

%T 1,0,1,0,1,1,0,1,0,0,2,0,0,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,2,0,0,0,

%U 1,1,0,0,0,1,1,0,1,1,0,1,0,0,0,1,2,0,1,0,0,2

%N The number of divisors d of n of the form d == 5 (mod 8).

%C a(5n) >= 1 as d=5 contributes to the count.

%H Antti Karttunen, <a href="/A188171/b188171.txt">Table of n, a(n) for n = 1..10000</a>

%H Michael D. Hirschhorn, <a href="http://dx.doi.org/10.1016/j.disc.2004.08.045">The number of representations of a number by various forms</a>, Discrete Mathematics 298 (2005), 205-211.

%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 A188169(n)+a(n) = A001826(n).

%F A188169(n)+A188170(n)-a(n)-A188172(n) = A002325(n).

%F G.f.: Sum_{k>=1} x^(5*k)/(1 - x^(8*k)). - _Ilya Gutkovskiy_, Sep 11 2019

%F Sum_{k=1..n} a(k) = n*log(n)/8 + c*n + O(n^(1/3)*log(n)), where c = gamma(5,8) - (1 - gamma)/8 = -0.131189..., gamma(5,8) = -(psi(5/8) + log(8))/8 is a generalized Euler constant, and gamma is Euler's constant (A001620) (Smith and Subbarao, 1981). - _Amiram Eldar_, Nov 25 2023

%e a(13) = 1 because the divisor d=13 is 8+5 == 5 (mod 8).

%p sigmamr := proc(n,m,r) local a,d ; a := 0 ; for d in numtheory[divisors](n) do if modp(d,m) = r then a := a+1 ; end if; end do: a; end proc:

%p A188171 := proc(n) sigmamr(n,8,5) ; end proc:

%t a[n_] := DivisorSum[n, 1 &, Mod[#, 8] == 5 &]; Array[a, 100] (* _Amiram Eldar_, Nov 25 2023 *)

%o (PARI) A188171(n) = sumdiv(n, d, (5==(d%8))); \\ _Antti Karttunen_, Jul 09 2017

%Y Cf. A001826, A002325, A188169, A188170, A188172.

%Y Cf. A001620, A016631, A354634 (psi(5/8)).

%K nonn,easy

%O 1,45

%A _R. J. Mathar_, Mar 23 2011