MATHEMATICA
Accumulate[Table[If[IntegerQ[Surd[n, 6]], 0, n], {n, 60}]] (* Harvey P. Dale, Jun 01 2022 *)
FORMULA
Let r = floor(n^(1/6)). Then a(n) = n(n+1)/2 - (r^7/7 + r^6/2 + r^5/2 - r^3/6 + r/42) = A000217(n) - A000540(r).
EXTENSIONS
Edited by the Assoc. Editors of the OEIS, Oct 12 2010. Thanks to _Daniel Mondot _ for pointing out that the sequence needed editing.
Discussion
Thu Apr 11
15:04
Michel Marcus: yes, for me, recurrence fails at 64, 65, 66, 729, 730, 731, 4096, 4097, 4098, ...
15:34
Peter Luschny: What is striking is that several of the recurrences rightly complained about by Georg have the same author, who, however, does not appear by name at all. For me, this is also a failure of the method of signing contributions.
Fri Apr 12
05:33
Vaclav Kotesovec: b-file is correct
EXTENSIONS
Incorrect program replaced by _R. J. Mathar, _, Oct 08 2010