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.

A023531 a(n) = 1 if n is of the form m(m+3)/2, otherwise 0.

This page as a plain text file.
%I A023531 #120 May 15 2025 12:34:34
%S A023531 1,0,1,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,
%T A023531 0,1,0,0,0,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,1,0,0,
%U A023531 0,0,0,0,0,0,0,0,0,1,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,1
%N A023531 a(n) = 1 if n is of the form m(m+3)/2, otherwise 0.
%C A023531 Can be read as table: a(n,m) = 1 if n = m >= 0, else 0 (unit matrix).
%C A023531 a(n) = number of 1's between successive 0's (see also A005614, A003589 and A007538). - _Eric Angelini_, Jul 06 2005
%C A023531 Triangle T(n,k), 0 <= k <= n, read by rows, given by A000004 DELTA A000007 where DELTA is the operator defined in A084938. - _Philippe Deléham_, Jan 03 2009
%C A023531 Sequence B is called a reverse reluctant sequence of sequence A, if B is triangle array read by rows: row number k lists first k elements of the sequence A in reverse order.
%C A023531 A023531 is reverse reluctant sequence of sequence A000007. - _Boris Putievskiy_, Jan 11 2013
%C A023531 Also the Bell transform (and the inverse Bell transform) of 0^n (A000007). For the definition of the Bell transform see A264428. - _Peter Luschny_, Jan 19 2016
%C A023531 This is the turn sequence of the triangle spiral.  To form the spiral: go a unit step forward, turn left a(n)*120 degrees, and repeat.  The triangle sides are the runs of a(n)=0 (no turn).  The sequence can be generated by a morphism with a special symbol S for the start of the sequence: S -> S,1; 1 -> 0,1; 0->0.  The expansion lengthens each existing side and inserts a new unit side at the start.  See the Fractint L-system in the links to draw the spiral this way. - _Kevin Ryde_, Dec 06 2019
%H A023531 Antti Karttunen, <a href="/A023531/b023531.txt">Table of n, a(n) for n = 0..100127</a>
%H A023531 Wolfdieter Lang, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL3/LANG/lang.html">On generalizations of Stirling number triangles</a>, J. Integer Seqs., Vol. 3 (2000), Article 00.2.4.
%H A023531 Boris Putievskiy, <a href="http://arxiv.org/abs/1212.2732">Transformations Integer Sequences And Pairing Functions</a> arXiv:1212.2732 [math.CO], 2012.
%H A023531 Franck Ramaharo, <a href="https://arxiv.org/abs/1805.10680">A generating polynomial for the pretzel knot</a>, arXiv:1805.10680 [math.CO], 2018.
%H A023531 Kevin Ryde, <a href="/A023531/a023531.l.txt">Fractint L-System drawing the spiral</a>.
%H A023531 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/JacobiThetaFunctions.html">Jacobi Theta Functions</a>.
%H A023531 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/ModifiedBesselFunctionoftheFirstKind.html">Modified Bessel Function of the First Kind</a>.
%H A023531 <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>.
%F A023531 If (floor(sqrt(2*n))-(2*n/(floor(sqrt(2*n)))) = -1, 1, 0). - _Gerald Hillier_, Sep 11 2005
%F A023531 a(n) = 1 - A023532(n); a(n) = 1 - mod(floor(((10^(n+2) - 10)/9)10^(n+1 - binomial(floor((1+sqrt(9+8n))/2), 2) - (1+floor(log((10^(n+2) - 10)/9, 10))))), 10). - _Paul Barry_, May 25 2004
%F A023531 a(n) = floor((sqrt(9+8n)-1)/2) - floor((sqrt(1+8n)-1)/2). - _Paul Barry_, May 25 2004
%F A023531 a(n) = round(sqrt(2n+3)) - round(sqrt(2n+2)). - _Hieronymus Fischer_, Aug 06 2007
%F A023531 a(n) = ceiling(2*sqrt(2n+3)) - floor(2*sqrt(2n+2)) - 1. - _Hieronymus Fischer_, Aug 06 2007
%F A023531 From _Franklin T. Adams-Watters_, Jun 29 2009: (Start)
%F A023531 G.f.: (1/2 x^{-1/8}theta_2(0,x^{1/2}) - 1)/x, where theta_2 is a Jacobi theta function.
%F A023531 G.f. for triangle: Sum T(n,k) x^n y^k = 1/(1-x*y). Sum T(n,k) x^n y^k / n! = Sum T(n,k) x^n y^k / k! = exp(x*y). Sum T(n,k) x^n y^k / (n! k!) = I_0(2*sqrt(x*y)), where I is the modified Bessel function of the first kind. (End)
%F A023531 a(n) = A000007(m), where m=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2). - _Boris Putievskiy_, Jan 11 2013
%F A023531 The row polynomials are p(n,x) = x^n = (-1)^n n!Lag(n,-n,x), the normalized, associated Laguerre polynomials of order -n. As the prototypical Appell sequence with e.g.f. exp(x*y), its raising operator is R = x and lowering operator, L = d/dx, i.e., R p(n,x) = p(n+1,x), and L p(n,x) = n * p(n-1,x). - _Tom Copeland_, May 10 2014
%F A023531 a(n) = A010054(n+1) if n >= 0. - _Michael Somos_, May 17 2014
%F A023531 a(n) = floor(sqrt(2*(n+1)+1/2)-1/2) - floor(sqrt(2*n+1/2)-1/2). - _Mikael Aaltonen_, Jan 18 2015
%F A023531 a(n) = A003057(n+3) - A003057(n+2). - _Robert Israel_, Jan 18 2015
%F A023531 a(A000096(n)) = 1; a(A007701(n)) = 0. - _Reinhard Zumkeller_, Feb 14 2015
%F A023531 Characteristic function of A000096. - _M. F. Hasler_, Apr 12 2018
%F A023531 Sum_{k=1..n} a(k) ~ sqrt(2*n). - _Amiram Eldar_, Jan 13 2024
%e A023531 As a triangle:
%e A023531        1
%e A023531       0 1
%e A023531      0 0 1
%e A023531     0 0 0 1
%e A023531    0 0 0 0 1
%e A023531   0 0 0 0 0 1
%e A023531 G.f. = 1 + x^2 + x^5 + x^9 + x^14 + x^20 + x^27 + x^35 + x^44 + x^54 + ...
%e A023531 From _Kevin Ryde_, Dec 06 2019: (Start)
%e A023531 .
%e A023531               1            Triangular spiral: start at S;
%e A023531              / \             go a unit step forward,
%e A023531             0   0   .        turn left a(n)*120 degrees,
%e A023531            /     \   .       repeat.
%e A023531           0   1   0   .
%e A023531          /   / \   \   \   Each side's length is 1 greater
%e A023531         0   0   0   0   0    than that of the previous side.
%e A023531        /   /     \   \   \
%e A023531       0   0   S---1   0   0
%e A023531      /   /             \   \
%e A023531     0   1---0---0---0---1   0
%e A023531    /                         \
%e A023531   1---0---0---0---0---0---0---1
%e A023531 (End)
%p A023531 seq(op([0$m,1]),m=0..10); # _Robert Israel_, Jan 18 2015
%p A023531 # alternative
%p A023531 A023531 := proc(n)
%p A023531     option remember ;
%p A023531     local m,t ;
%p A023531     for m from 0 do
%p A023531         t := m*(m+3)/2 ;
%p A023531         if t > n then
%p A023531             return 0 ;
%p A023531         elif t = n then
%p A023531             return 1 ;
%p A023531         end if;
%p A023531     end do:
%p A023531 end proc:
%p A023531 seq(A023531(n),n=0..40) ; # _R. J. Mathar_, May 15 2025
%t A023531 If[IntegerQ[(Sqrt[9+8#]-3)/2],1,0]&/@Range[0,100] (* _Harvey P. Dale_, Jul 27 2011 *)
%t A023531 a[ n_] := If[ n < 0, 0, Boole @ IntegerQ @ Sqrt[ 8 n + 9]]; (* _Michael Somos_, May 17 2014 *)
%t A023531 a[ n_] := SeriesCoefficient[ (EllipticTheta[ 2, 0, x^(1/2)] / (2 x^(1/8)) - 1) / x, {x, 0, n}]; (* _Michael Somos_, May 17 2014 *)
%o A023531 (Haskell)
%o A023531 a023531 n = a023531_list !! n
%o A023531 a023531_list = concat $ iterate ([0,1] *) [1]
%o A023531 instance Num a => Num [a] where
%o A023531    fromInteger k = [fromInteger k]
%o A023531    (p:ps) + (q:qs) = p + q : ps + qs
%o A023531    ps + qs         = ps ++ qs
%o A023531    (p:ps) * qs'@(q:qs) = p * q : ps * qs' + [p] * qs
%o A023531    _ * _               = []
%o A023531 -- _Reinhard Zumkeller_, Apr 02 2011
%o A023531 (Sage)
%o A023531 def A023531_row(n) :
%o A023531     if n == 0: return [1]
%o A023531     return [0] + A023531_row(n-1)
%o A023531 for n in (0..9): print(A023531_row(n))  # _Peter Luschny_, Jul 22 2012
%o A023531 (PARI) {a(n) = if( n<0, 0, issquare(8*n + 9))}; /* _Michael Somos_, May 17 2014 */
%o A023531 (PARI) A023531(n)=issquare(8*n+9) \\ _M. F. Hasler_, Apr 12 2018
%o A023531 (Python)
%o A023531 from math import isqrt
%o A023531 def A023531(n): return int((k:=n+1<<1)==(m:=isqrt(k))*(m+1)) # _Chai Wah Wu_, Nov 09 2024
%Y A023531 Cf. A000217, A003057, A010054, A000007, A023532.
%Y A023531 Cf. A000096, A007701, A024316.
%K A023531 nonn,easy,tabl,nice
%O A023531 0,1
%A A023531 _Clark Kimberling_, Jun 14 1998