cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A023533 a(n) = 1 if n is of the form m(m+1)(m+2)/6, and 0 otherwise.

This page as a plain text file.
%I A023533 #60 Sep 15 2024 22:03:44
%S A023533 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,
%T A023533 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,
%U A023533 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
%N A023533 a(n) = 1 if n is of the form m(m+1)(m+2)/6, and 0 otherwise.
%C A023533 a(n) is the characteristic function of tetrahedral numbers (A000292). - _Mikael Aaltonen_, Mar 28 2015
%H A023533 Danny Rorabaugh, <a href="/A023533/b023533.txt">Table of n, a(n) for n = 0..10000</a>
%H A023533 <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>.
%F A023533 a(A000292(n))=1; a(A145397(n))=0; a(n)=1-A014306(n). - _Reinhard Zumkeller_, Oct 14 2008
%F A023533 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
%t A023533 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 *)
%t A023533 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 *)
%o A023533 (Sage) # Generates an array with at least N terms.
%o A023533 def A023533_list(N):
%o A023533     A = []
%o A023533     for m in range(ceil((6*N)^(1/3))):
%o A023533         A.extend([0]*(binomial(m+2, 3) - len(A)) + [1])
%o A023533     return A
%o A023533 print(A023533_list(40))
%o A023533 # _Danny Rorabaugh_, Mar 16 2015
%o A023533 (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
%o A023533 (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
%Y A023533 Cf. A000292, A014306, A145397.
%K A023533 nonn,easy
%O A023533 0,1
%A A023533 _Clark Kimberling_, Jun 14 1998