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.

Showing 1-3 of 3 results.

A128182 Binomial transform of A128180.

Original entry on oeis.org

1, 0, 2, 1, 3, 3, 2, 6, 8, 4, 4, 12, 18, 15, 5, 8, 24, 38, 40, 24, 6, 16, 48, 78, 93, 75, 35, 7, 32, 96, 158, 202, 194, 126, 48, 8, 64, 192, 318, 423, 453, 362, 196, 63, 9, 128, 384, 638, 868, 996, 914, 622, 288, 80, 10
Offset: 0

Views

Author

Gary W. Adamson, Feb 17 2007

Keywords

Comments

Row sums = 1, 2, 7, 20, 54, 140, 352, 864, 2080, 4928,

Examples

			First few rows of the triangle are:
1;
0, 2;
1, 3, 3;
2, 6, 8, 4;
4, 12, 18, 15, 5;
8, 24, 38, 40, 24, 6;
16, 48, 78, 93, 75, 35, 7;
...
		

Crossrefs

Formula

A007318 * A128180 as infinite lower triangular matrices.

A209279 First inverse function (numbers of rows) for pairing function A185180.

Original entry on oeis.org

1, 1, 2, 2, 1, 3, 2, 3, 1, 4, 3, 2, 4, 1, 5, 3, 4, 2, 5, 1, 6, 4, 3, 5, 2, 6, 1, 7, 4, 5, 3, 6, 2, 7, 1, 8, 5, 4, 6, 3, 7, 2, 8, 1, 9, 5, 6, 4, 7, 3, 8, 2, 9, 1, 10, 6, 5, 7, 4, 8, 3, 9, 2, 10, 1, 11, 6, 7, 5, 8, 4, 9, 3, 10, 2, 11, 1, 12, 7, 6, 8, 5, 9, 4, 10, 3, 11, 2, 12, 1, 13
Offset: 1

Views

Author

Boris Putievskiy, Jan 15 2013

Keywords

Comments

The triangle equals A158946 with the first column removed. - Georg Fischer, Jul 26 2023

Examples

			The start of the sequence as table T(r,s) r,s >0 read by antidiagonals:
  1...1...2...2...3...3...4...4...
  2...1...3...2...4...3...5...4...
  3...1...4...2...5...3...6...4...
  4...1...5...2...6...3...7...4...
  5...1...6...2...7...3...8...4...
  6...1...7...2...8...3...9...4...
  7...1...8...2...9...3..10...4...
  ...
The start of the sequence as triangle array read by rows:
  1;
  1, 2;
  2, 1, 3;
  2, 3, 1, 4;
  3, 2, 4, 1, 5;
  3, 4, 2, 5, 1, 6;
  4, 3, 5, 2, 6, 1, 7;
  4, 5, 3, 6, 2, 7, 1, 8;
  ...
Row number r contains permutation numbers form 1 to r.
If r is odd (r+1)/2, (r+1)/2-1, (r+1)/2+1,...r-1, 1, r.
If r is even r/2, r/2+1, r/2-1, ... r-1, 1, r.
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := Abs[(2*k - 1 + (-1)^(n - k)*(2*n + 1))/4];
    Table[T[n, k], {n, 1, 15}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jun 14 2018, after Andrew Howroyd *)
  • PARI
    T(n, k)=abs((2*k-1+(-1)^(n-k)*(2*n+1))/4) \\ Andrew Howroyd, Dec 31 2017
    
  • Python
    # Edited by M. F. Hasler, May 30 2020
    def a(n):
       t = int((math.sqrt(8*n-7) - 1)/2);
       i = n-t*(t+1)/2;
       return int(t/2)+1+int(i/2)*(-1)**(i+t+1)

Formula

a(n) = floor((A003056(n)+2)/2)+ floor(A002260(n)/2)*(-1)^(A002260(n)+A003056(n)+1).
a(n) = |A128180(n)|.
a(n) = floor((t+2)/2) + floor(i/2)*(-1)^(i+t+1), where t=floor((-1+sqrt(8*n-7))/2), i=n-t*(t+1)/2.
T(r,2s)=s, T(r,2s-1)= r+s-1.(When read as table T(r,s) by antidiagonals.)
T(n,k) = ceiling((n + (-1)^(n-k)*k)/2) = (n+k)/2 if n-k even, otherwise (n-k+1)/2. - M. F. Hasler, May 30 2020

Extensions

Data corrected by Andrew Howroyd, Dec 31 2017

A332104 Triangle read by rows in which row n >= 0 lists numbers from 0 to n starting at floor(n/2) and using alternatively larger respectively smaller numbers than the values used so far.

Original entry on oeis.org

0, 0, 1, 1, 0, 2, 1, 2, 0, 3, 2, 1, 3, 0, 4, 2, 3, 1, 4, 0, 5, 3, 2, 4, 1, 5, 0, 6, 3, 4, 2, 5, 1, 6, 0, 7, 4, 3, 5, 2, 6, 1, 7, 0, 8, 4, 5, 3, 6, 2, 7, 1, 8, 0, 9, 5, 4, 6, 3, 7, 2, 8, 1, 9, 0, 10, 5, 6, 4, 7, 3, 8, 2, 9, 1, 10, 0, 11, 6, 5, 7, 4, 8, 3, 9, 2, 10, 1, 11, 0, 12
Offset: 0

Views

Author

M. F. Hasler, May 30 2020

Keywords

Comments

The idea is to cover the range 0..n starting from the center and approaching the limiting values in the most symmetric way, using the smaller value in case of a tie, which leads to each row ending in (the first occurrence of) n.
Contains any sequence of nonnegative integers as a subsequence.

Examples

			The table starts:
Row 0:  0;
Row 1:  0, 1;
Row 2:  1, 0, 2;
Row 3:  1, 2, 0, 3;
Row 4:  2, 1, 3, 0, 4;
Row 5:  2, 3, 1, 4, 0, 5;
Row 5:  3, 2, 4, 1, 5, 0, 6;
Row 6:  3, 4, 2, 5, 1, 6, 0, 7;
Row 7:  4, 3, 5, 2, 6, 1, 7, 0, 8;
Row 8:  4, 5, 3, 6, 2, 7, 1, 8, 0, 9;
Row 9:  5, 4, 6, 3, 7, 2, 8, 1, 9, 0, 10;
Row 10: 5, 6, 4, 7, 3, 8, 2, 9, 1, 10, 0, 11; ...
Column 1 is floor(n/2) = A004526(n).
The "diagonal" (last element of each row) are the nonnegative integers A001477.
The first subdiagonal is the zero sequence A000004.
The second subdiagonal is the set of positive integers A000027.
The third subdiagonal is "all ones" sequence A000012.
And so on: in alternance, every other subdiagonal is the set of integers >= k, resp., k times the all ones sequence.
		

Crossrefs

Cf. A196199 (concatenate [-n .. n] for n=0, 1, 2...).
Cf. |A128180| = A209279 (based on a very similar idea with positive integers instead).

Programs

  • Mathematica
    Table[Floor[(n + (-1)^(n - k)*k)/2], {n, 0, 12}, {k, 0, n}] // Flatten (* Michael De Vlieger, Jul 03 2020 *)
  • PARI
    row(n)={ my(m=n\2, M=m, r=[m]); while(#r <= n, r=concat(r, if( n-M > m, M+=1, m-=1))); r}
    
  • PARI
    T(n,k)=(n+(-1)^(n-k)*k)\2

Formula

If columns are indexed starting from 0:
T(n,0) = floor(n/2) = A004526(n).
T(n,n-2*k) = n-k, for k >= 0.
T(n,n-2*k-1) = k, for k >= 0.
T(n,k) = floor((n+(-1)^(n-k)*k)/2) = (n+k)/2 if n+k even, otherwise floor((n-k)/2).
a(n) = |A128180(n)| - 1.
Showing 1-3 of 3 results.