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.

A025581 Triangle read by rows: T(n, k) = n-k, for 0 <= k <= n.

This page as a plain text file.
%I A025581 #127 Feb 16 2025 08:32:35
%S A025581 0,1,0,2,1,0,3,2,1,0,4,3,2,1,0,5,4,3,2,1,0,6,5,4,3,2,1,0,7,6,5,4,3,2,
%T A025581 1,0,8,7,6,5,4,3,2,1,0,9,8,7,6,5,4,3,2,1,0,10,9,8,7,6,5,4,3,2,1,0,11,
%U A025581 10,9,8,7,6,5,4,3,2,1,0,12,11,10,9,8,7,6,5,4,3,2,1,0,13,12,11,10,9,8,7,6,5,4,3
%N A025581 Triangle read by rows: T(n, k) = n-k, for 0 <= k <= n.
%C A025581 Decreasing integers m to 0 followed by decreasing integers m+1 to 0, etc.
%C A025581 The point with coordinates (x = A025581(n), y = A002262(n)) sweeps out the first quadrant by upwards antidiagonals. _N. J. A. Sloane_, Jul 17 2018
%C A025581 The PARI functions t1, t2 can be used to read a square array T(n,k) (n >= 0, k >= 0) by antidiagonals upwards: n -> T(t1(n), t2(n)). - _Michael Somos_, Aug 23 2002
%C A025581 Riordan array (x/(1-x)^2, x). - _Philippe Deléham_, Feb 18 2012
%C A025581 a(n,k) = (A214604(n,k) - A214661(n,k)) / 2. - _Reinhard Zumkeller_, Jul 25 2012
%C A025581 Sequence B is called a reverse reluctant sequence of sequence A if B is a triangular array read by rows such that row number k lists the first k terms of the sequence A in reverse order. This sequence is the reverse reluctant sequence of sequence 0,1,2,3,..., the nonnegative integers A001477. - _Boris Putievskiy_, Dec 13 2012
%C A025581 A problem posed by François Viète (Vieta) in his book Zeteticorum liber quinque (1593), liber 2, problem 19 (quoted in the Alten et al. reference, on p. 292) is to find for a rectangle (a >= b >= 1) with given a^3 - b^3, name it C, and a*b, name it F, the difference a-b, name it x. This is a simple exercise which Viète found remarkable. It reduces to a standard cubic equation for x, namely  x^3 + 3*F*x = C. Proof: Use the square of the diagonal d^2 = a^2 + b^2. Then (i) C = a^3 - b^3 = (a - b)*(a^2 + b^2 + a*b) = x*(d^2 + F). (ii) use the trivial relation d^2 = (a-b)^2 + 2*a*b = x^2 + 2*F, to eliminate d^2 in (i). End of the Proof. Here for positive integers a = n and b = k: (T(n, k)^2 + 3*A079904(n, k))*T(n, k) = A257238(n, k) (also true for n = k = 0). - _Wolfdieter Lang_, May 12 2015
%C A025581 See a comment on A051162 on the cubic equation for S = a+b in terms of Cplus = a^3 + b^3 and D = a - b. This equation leads to a - b = sqrt((4*Cplus -S^3)/(3*S)). - _Wolfdieter Lang_, May 15 2015
%C A025581 The entries correspond to the first of the 2 coordinates of the Cantor Pairs, specifically x=w-(CPKey-(w^2+w)/2), where w=floor((sqrt(8*CPKey+1)-1)/2) and CPKey=Cantor Pair key (A001477). The second of the coordinate pairs is A002262. - _Bill McEachen_, Sep 12 2015
%D A025581 H.-W. Alten et al., 4000 Jahre Algebra, 2. Auflage, Springer, 2014, p. 203.
%H A025581 Reinhard Zumkeller, <a href="/A025581/b025581.txt">Rows n = 0..100 of triangle, flattened</a>
%H A025581 Ângela Mestre and José Agapito, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL22/Mestre/mestre2.html">Square Matrices Generated by Sequences of Riordan Arrays</a>, J. Int. Seq., Vol. 22 (2019), Article 19.8.4.
%H A025581 Boris Putievskiy, <a href="http://arxiv.org/abs/1212.2732">Transformations Integer Sequences And Pairing Functions</a> arXiv:1212.2732 [math.CO], 2012.
%H A025581 Michael Somos, <a href="/A073189/a073189.txt">Sequences used for indexing triangular or square arrays</a>
%H A025581 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing Function</a>.
%F A025581 T(n, k) = n-k, for 0 <= k <= n.
%F A025581 As a sequence: a(n) = (((trinv(n)-1)*(((1/2)*trinv(n))+1))-n), with trinv(n) = floor((1+sqrt(1+8*n))/2). Cf. A002262.
%F A025581 a(n) = A004736(n+1) - 1.
%F A025581 G.f. for T(n,k): y / ((1-x)^2 * (1-x*y)). - _Ralf Stephan_, Jan 25 2005
%F A025581 For the cubic equation satisfied by T(n, k) see the comment on a problem by Viète above. - _Wolfdieter Lang_, May 12 2015
%F A025581 G.f. for a(n): -(1-x)^(-2) + (1-x)^(-1) * Sum_{n>=0} (n+1)*x^(n*(n+1)/2). The sum is related to Jacobi theta functions. - _Robert Israel_, May 12 2015
%F A025581 T(n, k) = sqrt((4*A105125(n, k) - A051162(n, k)^3)/(3*A051162(n, k))). See a comment above. - _Wolfdieter Lang_, May 15 2015
%F A025581 a(n) = (1/2)*(t^2 + t - 2*n - 2), where t = floor(sqrt(2*n+1) + 1/2) = round(sqrt(2*n+1)). - _Ridouane Oudra_, Dec 01 2019
%F A025581 a(n) = ((1/2) * ceiling((-1 + sqrt(9 + 8 * n))/2) * ceiling((1 + sqrt(9 + 8 * n))/2)) - n - 1. - _Ryan Jean_, Apr 22 2022
%e A025581 The triangle T(n, k) begins (note that one could use l <= k <= n, for any integer l, especially 1):
%e A025581   n\k  0 1 2 3 4 5 6 7 8 9 10 ...
%e A025581    0:  0
%e A025581    1:  1 0
%e A025581    2:  2 1 0
%e A025581    3:  3 2 1 0
%e A025581    4:  4 3 2 1 0
%e A025581    5:  5 4 3 2 1 0
%e A025581    6:  6 5 4 3 2 1 0
%e A025581    7:  7 6 5 4 3 2 1 0
%e A025581    8:  8 7 6 5 4 3 2 1 0
%e A025581    9:  9 8 7 6 5 4 3 2 1 0
%e A025581   10: 10 9 8 7 6 5 4 3 2 1 0
%e A025581   ... [formatted by _Wolfdieter Lang_, May 12 2015]
%p A025581 A025581 := n -> binomial(1+floor((1/2)+sqrt(2*(1+n))),2) - (n+1): seq(A025581(n), n=0..100);
%t A025581 Flatten[NestList[Prepend[#, #[[1]]+1]&, {0}, 13]] (* _Jean-François Alcover_, May 17 2011 *)
%t A025581 With[{nn=20},Flatten[Table[Join[{0},Reverse[Range[i]]],{i,nn}]]] (* _Harvey P. Dale_, Dec 31 2014 *)
%t A025581 Table[Range[n,0,-1],{n,0,15}]//Flatten (* _Harvey P. Dale_, Aug 01 2020 *)
%o A025581 (PARI) a(n)=binomial(1+floor(1/2+sqrt(2+2*n)),2)-(n+1) /* produces a(n) */
%o A025581 (PARI) t1(n)=binomial(floor(3/2+sqrt(2+2*n)),2)-(n+1) /* A025581 */
%o A025581 (PARI) t2(n)=n-binomial(floor(1/2+sqrt(2+2*n)),2) /* A002262 */
%o A025581 (PARI) apply( {A025581(n)=binomial(sqrtint(8*n+1)\/2+1,2)-n-1}, [0..90]) \\ _M. F. Hasler_, Dec 06 2019
%o A025581 (Haskell)
%o A025581 a025581 n k = n - k
%o A025581 a025581_row n = [n, n-1 .. 0]
%o A025581 a025581_tabl = iterate (\xs@(x:_) -> (x + 1) : xs) [0]
%o A025581 -- _Reinhard Zumkeller_, Aug 04 2014, Jul 22 2012, Mar 07 2011
%o A025581 (Magma) /* As triangle */ [[(n-k): k in [1..n]]: n in [1.. 15]]; // _Vincenzo Librandi_, Sep 13 2015
%o A025581 (Python)
%o A025581 from math import isqrt, comb
%o A025581 def A025581(n): return comb((m:=isqrt(k:=n+1<<1))+(k>m*(m+1))+1,2)-n-1 # _Chai Wah Wu_, Nov 08 2024
%Y A025581 Cf. A025669, A025676, A025683, A002262, A004736, A001477.
%Y A025581 Cf. A141418 (partial sums per row).
%Y A025581 Cf. A079904, A257238, A051162, A105125.
%K A025581 nonn,tabl,easy,nice
%O A025581 0,4
%A A025581 _David W. Wilson_
%E A025581 Typo in definition corrected by _Arkadiusz Wesolowski_, Nov 24 2011
%E A025581 Edited (part of name moved to first comment; definition of trinv added in formula) by _Wolfdieter Lang_, May 12 2015