OFFSET
1,1
COMMENTS
Terms which are triangular: 6, 136, 351, 741, 2415, 3916, 5995, 12561, 17391, 23436, ..., .
FORMULA
a(n) = Sum_{i=1..n} A014132(i).
EXAMPLE
The nontriangular numbers begin 2, 4, 5, 7, ..., so their partial sums begin 2, 6, 11, 18, etc.
MATHEMATICA
triQ[n_] := IntegerQ @ Sqrt[8n + 1]; Accumulate@ Select[ Range@ 70, !triQ@# &]
PROG
(Python)
from math import isqrt
def A329598(n): return (k:=(r:=isqrt(m:=n+1<<1))+int((m<<2)>(r<<2)*(r+1)+1)-1)*(k*(-k - 3) + 6*n - 2)//6 + (n*(n+3)>>1) # Chai Wah Wu, Jun 18 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Metin Sariyar and Robert G. Wilson v, Nov 17 2019
STATUS
approved