OFFSET
1,39
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
MATHEMATICA
nmax = 120;
A023533:= A023533 = With[{ms= Table[m(m+1)(m+2)/6, {m, 0, nmax+5}]}, Table[If[MemberQ[ms, n], 1, 0], {n, 0, nmax+5}]];
AbsoluteTiming[Table[t=0; m=3; p=BitShiftRight[n]; n--; While[n>p, t += A023533[[n + 1]]; n -= m++]; t, {n, nmax}]] (* G. C. Greubel, Jan 29 2022 *)
PROG
(Sage)
nmax=120
@CachedFunction
def A023531(n):
if ((sqrt(8*n+9) -3)/2).is_integer(): return 1
else: return 0
@CachedFunction
def B_list(N):
A = []
for m in range(ceil((6*N)^(1/3))):
A.extend([0]*(binomial(m+2, 3) -len(A)) +[1])
return A
A023533 = B_list(nmax+5)
@CachedFunction
[A023324(n) for n in (1..nmax)] # G. C. Greubel, Jan 29 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved