login
a(n) = sigma(n) - ceiling(n + sqrt n).
2

%I #23 Sep 08 2022 08:45:08

%S -1,-1,-1,1,-2,3,-2,4,1,4,-3,12,-3,6,5,11,-4,16,-4,17,6,9,-4,31,1,10,

%T 7,22,-5,36,-5,25,9,14,7,49,-6,15,10,43,-6,47,-6,33,26,19,-6,69,1,35,

%U 13,38,-7,58,9,56,15,24,-7,100,-7,26,33,55,10,69,-8,49,18,65,-8,114,-8,31,40,55,10,81,-8,97

%N a(n) = sigma(n) - ceiling(n + sqrt n).

%C a(n) >= 0 if n composite.

%D D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section III.1.1.a.

%D W. Sierpiński, Elementary Theory of Numbers. Państ. Wydaw. Nauk., Warsaw, 1964.

%H G. C. Greubel, <a href="/A079528/b079528.txt">Table of n, a(n) for n = 1..10000</a>

%H W. Sierpiński, <a href="http://matwbn.icm.edu.pl/kstresc.php?tom=42&amp;wyd=10">Elementary Theory of Numbers</a>, Warszawa 1964.

%t Table[DivisorSigma[1, n] -Ceiling[n +Sqrt[n]], {n, 1, 80}] (* _G. C. Greubel_, Jan 15 2019 *)

%o (PARI) vector(80, n, sigma(n) - ceil(n + sqrt(n))) \\ _Michel Marcus_, Dec 12 2014

%o (Magma) [SumOfDivisors(n)- Ceiling(n + Sqrt (n)): n in [1..100]]; // _Vincenzo Librandi_, Dec 13 2014

%o (Sage) [sigma(n,1) - ceil(n+sqrt(n)) for n in (1..80)] # _G. C. Greubel_, Jan 15 2019

%Y Cf. A079529, A055682, A058208.

%K sign

%O 1,5

%A _N. J. A. Sloane_, Jan 22 2003