OFFSET
1,1
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
From Jonathan Vos Post, Aug 28 2005: (Start)
a(n) = Sum_{i=1..n} A000037(i).
a(n) = Sum_{i=1..n} (i + floor(1/2 + sqrt(i))). (End)
a(n) = floor(1/2 + (n + sqrt(n))*(n/2 + sqrt(n)/6 + 1/3) - (floor(1/2 + sqrt(n)) - sqrt(n))^2*sqrt(n)). - Graeme McRae, Aug 28 2007
a(n) = n^2/2 + 2n*sqrt(n)/3 + O(n). - Charles R Greathouse IV, Aug 28 2016
MATHEMATICA
Accumulate[Table[n + Round[Sqrt[n]], {n, 120}]] (* Vladimir Joseph Stephan Orlovsky, Jul 08 2011 *)
Accumulate[DeleteCases[Range[80], _?(IntegerQ[Sqrt[#]]&)]] (* Harvey P. Dale, Jun 11 2024 *)
PROG
(Haskell)
a086849 n = a086849_list !! (n-1)
a086849_list = scanl1 (+) a000037_list
-- Reinhard Zumkeller, Oct 26 2015
(PARI) a(n)=my(k=n+(sqrtint(4*n)+1)\2, s=sqrtint(k)); k*(k+1)/2 - s*(s+1)*(2*s+1)/6 \\ Charles R Greathouse IV, Aug 28 2016
(Python)
from math import isqrt
def A086849(n): return (m:= n + isqrt(n + isqrt(n)))*(m + 1)//2 - (k:=isqrt(m))*(k + 1)*(2*k + 1)//6 # Chai Wah Wu, Mar 31 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Aug 18 2003
STATUS
approved