login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A086849
Sum of first n nonsquares.
10
2, 5, 10, 16, 23, 31, 41, 52, 64, 77, 91, 106, 123, 141, 160, 180, 201, 223, 246, 270, 296, 323, 351, 380, 410, 441, 473, 506, 540, 575, 612, 650, 689, 729, 770, 812, 855, 899, 944, 990, 1037, 1085, 1135, 1186, 1238, 1291, 1345, 1400, 1456, 1513, 1571, 1630
OFFSET
1,1
LINKS
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

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy