OFFSET
1,1
COMMENTS
Numbers not of the form 0^2 + 1^2 + 2^2 + ... + m^2 = m*(m + 1)*(2*m + 1)/6.
LINKS
Eric Weisstein's World of Mathematics, Square Pyramidal Number
FORMULA
a(n) = n+m if 6n>m(m-1)(2m+5) and a(n) = n+m-1 otherwise where m = floor((3n)^(1/3)). - Chai Wah Wu, Oct 01 2024
MATHEMATICA
Module[{nn=6, m}, m=(nn(nn+1)(2nn+1))/6 ; Complement[Range[m], Table[(n(n+1)(2n+1))/6, {n, nn}]]] (* Harvey P. Dale, Aug 22 2020 *)
PROG
(Python)
from sympy import integer_nthroot
def A302058(n): return n+(m:=integer_nthroot(3*n, 3)[0])-(6*n<=m*(m-1)*(2*m+5)) # Chai Wah Wu, Oct 01 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ilya Gutkovskiy, Mar 31 2018
STATUS
approved