login
a(n) = Sum_{i=1..n} d(24*i+1) - Sum_{i=1..n} d(6*i+1), where d(n) = A000005(n).
8

%I #27 Apr 12 2024 03:18:20

%S 1,2,2,1,2,4,5,4,4,4,6,7,7,5,4,10,10,10,8,9,11,10,12,10,10,13,15,14,

%T 12,14,14,14,16,16,17,17,19,21,19,20,20,18,16,16,18,24,24,23,23,21,28,

%U 28,28,24,24,26,25,27,27,28,30,30,32,28,28,30,28,30,28,29,33,39,39,37,35,39,40,38,36,36,38

%N a(n) = Sum_{i=1..n} d(24*i+1) - Sum_{i=1..n} d(6*i+1), where d(n) = A000005(n).

%C Every inequality in number theory of the form f(n) >= g(n) is a potential source of a sequence floor(f(n))-ceiling(g(n)).

%C That sequence can be negative (e.g., floor(2/3)-ceiling(1/3)=-1), but the other 3 differences floor(f(n))-floor(g(n)), ceiling(f(n))-ceiling(g(n)), and ceiling(f(n))-floor(g(n)) are nonnegative. - _Jonathan Sondow_, Oct 20 2013

%H Robert Israel, <a href="/A230290/b230290.txt">Table of n, a(n) for n = 1..10000</a>

%H Jorge Luis Cimadevilla Villacorta, <a href="http://www.jstor.org/stable/10.4169/amer.math.monthly.120.09.832">Certain inequalities associated with the divisor function</a>, Amer. Math. Monthly, 120 (2013), 832-837. (Shows that a(n) >= 0.)

%F a(n) = (2*log(2)/3) * n + O(n^(1/3)*log(n)). - _Amiram Eldar_, Apr 12 2024

%p with(numtheory);

%p f:=proc(n,a,b,c,d) local i; add(tau(a*i+b),i=1..n) - add(tau(c*i+d),i=1..n); end;

%p [seq(f(n,24,1,6,1),n=1..120)];

%p # More efficient:

%p ListTools:-PartialSums([seq(numtheory:-tau(24*i+1)-numtheory:-tau(6*i+1),i=1..120)]); # _Robert Israel_, Jan 03 2020

%t R = Range[100];

%t Accumulate[DivisorSigma[0, 24R+1] - DivisorSigma[0, 6R+1]] (* _Jean-François Alcover_, Jan 31 2023 *)

%o (PARI) vector(100, n, sum(i=1, n, numdiv(24*i+1)) - sum(i=1, n, numdiv(6*i+1))) \\ _Michel Marcus_, Oct 09 2014

%o (Magma) [&+[#Divisors(24*i+1):i in [1..n]] - &+[#Divisors(6*i+1):i in [1..n]]:n in [1..85]]; // _Marius A. Burtea_, Jan 03 2020

%Y Cf. A000005, A230291, A230292, A230293, A230294, A230295, A230296, A230476.

%K nonn

%O 1,2

%A _N. J. A. Sloane_, Oct 17 2013