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.

A143182 Triangle T(n,m) = 1 + abs(n-2*m), read by rows, 0<=m<=n.

This page as a plain text file.
%I A143182 #30 Sep 08 2022 08:45:37
%S A143182 1,2,2,3,1,3,4,2,2,4,5,3,1,3,5,6,4,2,2,4,6,7,5,3,1,3,5,7,8,6,4,2,2,4,
%T A143182 6,8,9,7,5,3,1,3,5,7,9,10,8,6,4,2,2,4,6,8,10,11,9,7,5,3,1,3,5,7,9,11,
%U A143182 12,10,8,6,4,2,2,4,6,8,10,12,13,11,9,7,5,3,1,3,5,7,9,11,13
%N A143182 Triangle T(n,m) = 1 + abs(n-2*m), read by rows, 0<=m<=n.
%C A143182 From _Boris Putievskiy_, Jan 15 2013: (Start)
%C A143182 General case see A187760. Let m be natural number. Table T(n,k) n, k > 0, T(n,k)=n-k+1, if n>=k, T(n,k)=k-n+m-1, if n < k.  Table T(n,k) read by antidiagonals. The first column of the table T(n,1) is the sequence of the natural numbers A000027. In all columns with number k (k > 1) the segment with the length of (k-1): {m+k-2, m+k-3, ..., m}  shifts the sequence A000027. For m=1 the result is A220073, for m=2 the result is A143182. (End)
%H A143182 G. C. Greubel, <a href="/A143182/b143182.txt">Rows n= 0.100 of triangle, flattened</a>
%H A143182 Boris Putievskiy, <a href="http://arxiv.org/abs/1212.2732">Transformations [Of] Integer Sequences And Pairing Functions</a>, arXiv:1212.2732 [math.CO], 2012.
%F A143182 Symmetry: T(n,m) = T(n,n-m).
%F A143182 From _Boris Putievskiy_, Jan 15 2013: (Start)
%F A143182 For the general case
%F A143182 a(n) = |(t+1)^2 - 2n| + m*floor((t^2+3t+2-2n)/(t+1)),
%F A143182 where t = floor((-1+sqrt(8*n-7))/2).
%F A143182 For m = 2
%F A143182 a(n) = |(t+1)^2 - 2n| + 2*floor((t^2+3t+2-2n)/(t+1)),
%F A143182 where t=floor((-1+sqrt(8*n-7))/2). (End)
%e A143182 From _Boris Putievskiy_, Jan 15 2013: (Start)
%e A143182 The start of the sequence as table:
%e A143182 1...2...3...4...5...6...7...8...9..10..11...
%e A143182 2...1...2...3...4...5...6...7...8...9..10...
%e A143182 3...2...1...2...3...4...5...6...7...8...9...
%e A143182 4...3...2...1...2...3...4...5...6...7...8...
%e A143182 5...4...3...2...1...2...3...4...5...6...7...
%e A143182 6...5...4...3...2...1...2...3...4...5...6...
%e A143182 7...6...5...4...3...2...1...2...3...4...5...
%e A143182 8...7...6...5...4...3...2...1...2...3...4...
%e A143182 9...8...7...6...5...4...3...2...1...2...3...
%e A143182 10..9...8...7...6...5...4...3...2...1...2...
%e A143182 11.10...9...8...7...6...5...4...3...2...1...
%e A143182 . . .
%e A143182 The start of the sequence as triangle array read by rows: (End)
%e A143182    1;
%e A143182    2, 2;
%e A143182    3, 1, 3;
%e A143182    4, 2, 2, 4;
%e A143182    5, 3, 1, 3, 5;
%e A143182    6, 4, 2, 2, 4, 6;
%e A143182    7, 5, 3, 1, 3, 5, 7;
%e A143182    8, 6, 4, 2, 2, 4, 6, 8;
%e A143182    9, 7, 5, 3, 1, 3, 5, 7, 9;
%e A143182   10, 8, 6, 4, 2, 2, 4, 6, 8, 10;
%e A143182   11, 9, 7, 5, 3, 1, 3, 5, 7,  9, 11;
%e A143182 . . .
%e A143182 Row number r contains r numbers: r, r-2,...3,1,3,...r-2,r if r is odd,
%e A143182 r, r-2,...2,2,...r-2,r, if r is even. - _Boris Putievskiy_, Jan 15 2013
%t A143182 T[n_, m_]:= 1+Abs[(1+n-m) - (1+m)]; Table[Table[t[n, m], {m,0,n}], {n, 0, 15}]//Flatten
%o A143182 (PARI) for(n=0,15, for(k=0,n, print1(1+abs(n-2*k), ", "))) \\ _G. C. Greubel_, Jul 23 2019
%o A143182 (Magma) [1+Abs(n-2*k): k in [0..n], n in [0..15]]; // _G. C. Greubel_, Jul 23 2019
%o A143182 (Sage) [[1+abs(n-2*k) for k in (0..n)] for n in (0..15)] # _G. C. Greubel_, Jul 23 2019
%o A143182 (GAP) Flat(List([0..15], n-> List([0..n], k-> 1+AbsInt(n-2*k) ))); # _G. C. Greubel_, Jul 23 2019
%Y A143182 Cf. A049581 (subtract 1's), A074148 (row sums), A000027, A220073, A187760.
%K A143182 nonn,easy,tabl
%O A143182 0,2
%A A143182 _Roger L. Bagula_ and _Gary W. Adamson_, Oct 17 2008
%E A143182 Offset and row sums corrected by _R. J. Mathar_, Jul 05 2012