OFFSET
1,1
COMMENTS
Paraphrasing the Jovovic formula: if n is not a square then a(n) = sigma(n), the sum of divisors of n, otherwise a(n) = sigma(n) + sqrt(n). - Omar E. Pol, Jun 23 2009
Row sums of A161901. - Omar E. Pol, Jan 06 2014
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16384
FORMULA
a(n) = A066839(n)+A070038(n) = A000203(n)+A037213(n). G.f.: Sum_{n>0} n*x^n*(x^(n*(n-1))-x^(n^2)+1)/(1-x^n). - Vladeta Jovovic, Jan 25 2003
a(n) = sum_{i=1..floor(sqrt(n))} (n+i^2)*(1-ceiling(n/i)+floor(n/i))/i. - Wesley Ivan Hurt, Jul 14 2014
EXAMPLE
a(4)=9 because pairs of factors are 1*4 and 2*2 and 1+4+2+2=9. a(6)=12 because pairs of factors are 1*6 and 2*3 and 1+6+2+3=12.
MAPLE
A060866 := proc(n)
numtheory[sigma](n) ;
if issqr(n) then
%+sqrt(n) ;
else
% ;
end if;
end proc: # R. J. Mathar, Oct 24 2011
MATHEMATICA
Table[Sum[(i^2 + n) (1 - Ceiling[n/i] + Floor[n/i])/i, {i, Floor[Sqrt[n]]}], {n, 100}] (* Wesley Ivan Hurt, Jul 14 2014 *)
Array[If[IntegerQ@ #2, #3 + #2, #3] & @@ {#, Sqrt@ #, DivisorSigma[1, #]} &, 69] (* Michael De Vlieger, Nov 23 2017 *)
PROG
(PARI)
A037213(n) = if(issquare(n, &n), n, 0);
A060866(n) = (sigma(n)+A037213(n)); \\ Antti Karttunen, Nov 23 2017, after Jan 25 2003 formula of Vladeta Jovovic
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jason Earls, May 04 2001
EXTENSIONS
More terms from Erich Friedman, Jun 03 2001
STATUS
approved