OFFSET
1,1
COMMENTS
Numbers that are not the sum of the first k cubes.
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..11011
Eric Weisstein's World of Mathematics, Triangular Number
FORMULA
a(n) = n+m if 4n>m*(m-1)*(m^2+3*m+4) and a(n) = n+m-1 otherwise where m = floor((4n)^(1/4)).
MATHEMATICA
A376573[n_] := With[{m = Floor[(4*n)^(1/4)]}, n + m - Boole[4*n <= m*(m - 1)*(m*(m + 3) + 4)]];
Array[A376573, 96] (* or *)
Complement[Range[Last[#]], #] & [Accumulate[Range[4]^3]] (* Paolo Xausa, Oct 04 2024 *)
PROG
(Python)
from sympy import integer_nthroot
def A376573(n): return n+(m:=integer_nthroot(k:=n<<2, 4)[0])-(k<=m*(m-1)*(m**2+3*m+4))
(PARI) isok(k) = !issquare(k) || (issquare(k) && !ispolygonal(sqrtint(k), 3)); \\ Michel Marcus, Oct 02 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Chai Wah Wu, Oct 02 2024
STATUS
approved