login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A023533
a(n) = 1 if n is of the form m(m+1)(m+2)/6, and 0 otherwise.
63
1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
OFFSET
0,1
COMMENTS
a(n) is the characteristic function of tetrahedral numbers (A000292). - Mikael Aaltonen, Mar 28 2015
FORMULA
a(A000292(n))=1; a(A145397(n))=0; a(n)=1-A014306(n). - Reinhard Zumkeller, Oct 14 2008
For n > 0, a(n) = floor(t(n+1) + 1/(3 * t(n+1)) - 1) - floor(t(n) + 1/(3 * t(n)) - 1), where t(n) = ( sqrt(243*n^2-1)/3^(3/2) + 3*n )^(1/3). - Mikael Aaltonen, Mar 28 2015; corrected by Michel Marcus, Jul 17 2022
MATHEMATICA
With[{ms=Table[m(m+1)(m+2)/6, {m, 0, 20}]}, Table[If[MemberQ[ms, n], 1, 0], {n, 0, 100}]] (* Harvey P. Dale, Jul 25 2011 *)
a[n_]:=Boole[Binomial[Floor[(6n-1)^(1/3)]+2, 3] == n]; Array[a, 99, 0] (* Stefano Spezia, Sep 15 2024 after Michel Marcus, Jul 19 2022 *)
PROG
(Sage) # Generates an array with at least N terms.
def A023533_list(N):
A = []
for m in range(ceil((6*N)^(1/3))):
A.extend([0]*(binomial(m+2, 3) - len(A)) + [1])
return A
print(A023533_list(40))
# Danny Rorabaugh, Mar 16 2015
(PARI) lista(nn) = {v = vector(nn); for (n=0, nn, i = 1+n*(n+1)*(n+2)/6; if (i > nn, break); v[i] = 1; ); v; } \\ Michel Marcus, Mar 16 2015
(PARI) a(n) = if(n==0, return(1)); my(t = sqrtnint(6*n-1, 3)); binomial(t+2, 3) == n; \\ Michel Marcus, Jul 19 2022; after A014306
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jun 14 1998
STATUS
approved