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-6 of 6 results.

A088372 Table read by rows where T(0,0)=0; n-th row has 2^n terms T(n,j),j=0 to 2^n-1. T(n,T088208(n,j))=2^n-j, where T088208 is the table described in A088208.

Original entry on oeis.org

0, 2, 1, 4, 1, 3, 2, 8, 1, 5, 4, 7, 2, 6, 3, 16, 1, 9, 8, 13, 4, 12, 5, 15, 2, 10, 7, 14, 3, 11, 6, 32, 1, 17, 16, 25, 8, 24, 9, 29, 4, 20, 13, 28, 5, 21, 12, 31, 2, 18, 15, 26, 7, 23, 10, 30, 3, 19, 14, 27, 6, 22, 11, 64, 1, 33, 32, 49, 16, 48, 17, 57, 8, 40, 25, 56, 9, 41, 24, 61, 4, 36
Offset: 0

Views

Author

Gary W. Adamson, Sep 28 2003

Keywords

Comments

A Thue-Morse generator using the "Ordering of Iterates" algorithm.

Examples

			0
2 1
4 1 3 2
8 1 5 4 7 2 6 3
...
		

References

  • Manfred R. Schroeder, "Fractals, Chaos, Power Laws", W.H. Freeman, 1991, p. 282, 265.

Crossrefs

Extensions

Edited by Ray Chandler and N. J. A. Sloane, Oct 08 2003

A049773 Triangular array T read by rows: if row n is r(1),...,r(m), then row n+1 is 2r(1)-1,...,2r(m)-1,2r(1),...,2r(m).

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 4, 1, 5, 3, 7, 2, 6, 4, 8, 1, 9, 5, 13, 3, 11, 7, 15, 2, 10, 6, 14, 4, 12, 8, 16, 1, 17, 9, 25, 5, 21, 13, 29, 3, 19, 11, 27, 7, 23, 15, 31, 2, 18, 10, 26, 6, 22, 14, 30, 4, 20, 12, 28, 8, 24, 16, 32, 1, 33, 17, 49, 9, 41, 25, 57, 5, 37, 21, 53, 13, 45, 29, 61, 3, 35, 19
Offset: 1

Views

Author

Keywords

Comments

n-th row = (r(1),r(2),...,r(m)), where m=2^(n-1), satisfies r(r(k))=k for k=1,2,...,m and has exactly 2^[ n/2 ] solutions of r(k)=k. (The function r(k) reverses bits. Or rather, r(k)=revbits(k-1)+1.)
In a knockout competition with m players, arranging the competition brackets (see links) in r(k) order, where k is the rank of the player, ensures that highest ranked players cannot meet until the later stages of the competition. None of the top 2^p ranked players can meet earlier than the p-th from last round of the competition. At the same time the top ranked players in each match meet the highest ranked player possible consistent with this rule. The sequence for the top ranked players meeting the lowest ranked player possible is A131271. - Colin Hall, Jul 31 2011, Feb 29 2012
Row n contains one of A003407(2^(n-1)) non-averaging permutations of [2^(n-1)], i.e., a permutation of [2^(n-1)] without 3-term arithmetic progressions. - Alois P. Heinz, Dec 05 2017

Examples

			Triangle begins:
1;
1,  2;
1,  3, 2,  4;
1,  5, 3,  7, 2,  6,  4,  8;
1,  9, 5, 13, 3, 11,  7, 15, 2, 10,  6, 14, 4, 12,  8, 16;
1, 17, 9, 25, 5, 21, 13, 29, 3, 19, 11, 27, 7, 23, 15, 31, 2, 18, 10, 26, ...
		

Crossrefs

Sum of odd-indexed terms of n-th row gives A007582. Sum of even-indexed terms gives A049775.
A030109 is another version.
Cf. A131271.
Cf. A088370.

Programs

  • Haskell
    a049773 n k = a049773_tabf !! (n-1) !! (k-1)
    a049773_row n = a049773_tabf !! (n-1)
    a049773_tabf = iterate f [1] where
       f vs = (map (subtract 1) ws) ++ ws where ws = map (* 2) vs
    -- Reinhard Zumkeller, Mar 14 2015
  • Maple
    T:= proc(n) option remember; `if`(n=1, 1,
          [map(x->2*x-1, [T(n-1)])[], map(x->2*x, [T(n-1)])[]][])
        end:
    seq(T(n), n=1..7);  # Alois P. Heinz, Oct 28 2011
  • Mathematica
    row[1] = {1}; row[n_] := row[n] = Join[ 2*row[n-1] - 1, 2*row[n-1] ]; Flatten[ Table[ row[n], {n, 1, 7}]] (* Jean-François Alcover, May 03 2012 *)
  • PARI
    (a(n, k) = if( k<=0 || k>=n, 0, if( k%2, n\2) + a(n\2, k\2))); {T(n, k) = if( k<=0 || k>2^n/2, 0, 1 + a(2^n/2, k-1))}; /* Michael Somos, Oct 13 1999 */
    

A131271 Triangular array T(n,k), n>=0, k=1..2^n, read by rows in bracketed pairs such that highest ranked element is bracketed with lowest ranked.

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 3, 1, 8, 4, 5, 2, 7, 3, 6, 1, 16, 8, 9, 4, 13, 5, 12, 2, 15, 7, 10, 3, 14, 6, 11, 1, 32, 16, 17, 8, 25, 9, 24, 4, 29, 13, 20, 5, 28, 12, 21, 2, 31, 15, 18, 7, 26, 10, 23, 3, 30, 14, 19, 6, 27, 11, 22, 1, 64, 32, 33, 16, 49, 17, 48, 8, 57
Offset: 0

Views

Author

J. Demongeot (Jacques.Demongeot(AT)imag.fr), Jun 24 2007

Keywords

Comments

In a knockout competition with 2^n players, arranging the competition brackets (see Wikipedia) in T(n,k) order, where T(n,k) is the rank of the k-th player, ensures that highest ranked players cannot meet until the later stages of the competition. None of the top 2^p ranked players can meet earlier than the p-th from last round of the competition. At the same time the top ranked players in each match meet the lowest ranked player possible consistent with this rule. The sequence for the top ranked players meeting the highest ranked player possible is A049773. - Colin Hall, Feb 28 2012
Ranks in natural order of 2^n increasing real numbers appearing in limit cycles of interval iterations, or Median Spiral Order. [See the works by Demongeot & Waku]
From Andrey Zabolotskiy, Dec 06 2024 (Start):
For n>0, row n-1 is the permutation relating row n of Kepler's tree of fractions with row n of the left half of Stern-Brocot tree. Specifically, if K_n(k) [resp. SB_n(k)] is the k-th fraction in the n-th row of A294442 [resp. A057432], where 1/2 is in row 1 and k=1..2^(n-1), then K_n(k) = SB_n(T(n-1, k)).
The inverse permutation is row n of A088208.
When 1 is subtracted from each term, rows 3-5 become A240908, A240909, A240910. (End)

Examples

			Triangle begins:
1;
1,  2;
1,  4, 2, 3;
1,  8, 4, 5, 2,  7, 3,  6;
1, 16, 8, 9, 4, 13, 5, 12, 2, 15, 7, 10, 3, 14, 6, 11;
...
		

Crossrefs

Cf. A005578 (last elements in rows), A155944 (T(n,2^(n-1)) for n>0).

Programs

  • Maple
    T:= proc(n,k) option remember;
          `if`({n, k} = {1}, 1,
          `if`(irem(k, 2)=1, T(n-1, (k+1)/2), 2^(n-1)+1 -T(n-1, k/2)))
        end:
    seq(seq(T(n, k), k=1..2^(n-1)), n=1..7); # Alois P. Heinz, Feb 28 2012, with offset 1
  • Mathematica
    T[0, 1] = 1;
    T[n_, k_] := T[n, k] = If[Mod[k, 2] == 1, T[n, (k + 1)/2], 2^n + 1 - T[n, k/2]];
    Table[T[n, k], {n, 0, 6}, {k, 2^n}] // Flatten (* Jean-François Alcover, May 31 2018, after Alois P. Heinz *)

Formula

T(0,1) = 1, T(n,2k-1) = T(n-1,k), T(n,2k) = 2^n+1 - T(n-1,k).
T(n,1) = 1; for 1 < k <= 2^n, T(n,k) = 1 + (2^n)/m - T(n,k-m), where m = A006519(k-1). - Mathew Englander, Jun 20 2021

Extensions

Edited (with new name from Colin Hall) by Andrey Zabolotskiy, Dec 06 2024

A088748 a(n) = 1 + Sum_{k=0..n-1} 2 * A014577(k) - 1.

Original entry on oeis.org

1, 2, 3, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2, 3, 4, 5, 4, 5, 6, 5, 4, 3, 4, 5, 4, 3, 4, 3, 2, 3, 4, 5, 4, 5, 6, 5, 4, 5, 6, 7, 6, 5, 6, 5, 4, 3, 4, 5, 4, 5, 6, 5, 4, 3, 4, 5, 4, 3, 4, 3, 2, 3, 4, 5, 4, 5, 6, 5, 4, 5, 6, 7, 6, 5, 6, 5, 4, 5, 6, 7, 6, 7, 8, 7, 6, 5, 6, 7, 6, 5, 6, 5, 4, 3, 4, 5, 4, 5, 6
Offset: 0

Views

Author

Gary W. Adamson, Oct 14 2003

Keywords

Comments

Let s(0)=1; s(n+1)=s(n),ri(n), where ri(n) is s(n) reversed and incremented. Each s(n) is an initial part of this sequence.
For each m, a(1 to 2^m) is a permutation of A063787(1 to 2^m). For k=1 to 2^m, a(2^m+1-A088372(m,k)) = A063787(k).
Partial sums give A164910: (1, 3, 6, 8, 11, 15, 20, ...).
a(0) = 1, then using the dragon curve sequence A014577: (1, 1, 0, 1, 1, ...) as a code: (1 = add to current term, 0 = subtract from current term, to get the next term), see example.
Rows of A088696 tend to this sequence.

Examples

			The first 8 terms of the sequence = (1, 2, 3, 2, 3, 4, 3, 2), where the first four terms = (1, 2, 3, 2). Reverse, add 1, getting (3, 4, 3, 2), then append.
The sequence begins with "1", then using the dragon curve coding, we get:
1...2...3...2...3...4... = A088748
....1...1...0...1...1... = A014577, the dragon curve.
		

Crossrefs

Programs

  • Mathematica
    Array[1 + Sum[2 (1 - (((Mod[#1, 2^(#2 + 2)]/2^#2)) - 1)/2) - 1 &[k, IntegerExponent[k, 2]], {k, # - 1}] &, 102] (* Michael De Vlieger, Aug 26 2020 *)

Formula

a(n) = 1 + A005811(n). [Joerg Arndt, Dec 11 2012]

Extensions

Edited by Don Reble, Nov 15 2005
Additional comments from Gary W. Adamson, Aug 30 2009
Edited by N. J. A. Sloane, Sep 06 2009

A057432 Obtained by reading first the numerator then the denominator of fractions in left-hand half of Stern-Brocot tree (A007305/A007306).

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 2, 3, 1, 4, 2, 5, 3, 5, 3, 4, 1, 5, 2, 7, 3, 8, 3, 7, 4, 7, 5, 8, 5, 7, 4, 5, 1, 6, 2, 9, 3, 11, 3, 10, 4, 11, 5, 13, 5, 12, 4, 9, 5, 9, 7, 12, 8, 13, 7, 11, 7, 10, 8, 11, 7, 9, 5, 6, 1, 7, 2, 11, 3, 14, 3, 13, 4, 15, 5, 18, 5, 17, 4, 13, 5, 14, 7, 19, 8, 21, 7, 18, 7, 17, 8, 19, 7
Offset: 0

Views

Author

N. J. A. Sloane, Sep 08 2000

Keywords

Examples

			The tree begins:
                                     1/1
                                     1/2
                  1/3                                   2/3
        1/4                 2/5               3/5                 3/4
    1/5      2/7       3/8       3/7     4/7       5/8       5/7      4/5
  1/6 2/9 3/11 3/10 4/11 5/13 5/12 4/9 5/9 7/12 8/13 7/11 7/10 8/11 7/9 5/6
		

Crossrefs

Related to the Kepler tree A294442 via row permutations given by A088208 or A131271.

Programs

  • Mathematica
    sbt[n_]:=Module[{P,L,Y},P={{1,0},{1,1}};L={{1,1},{0,1}};Y={{1,0},{0,1}}; w[b_]:=Fold[ #1.If[ #2==0,L,P]&,Y,b]; u[a_]:={a[[2,1]]+a[[2,2]],a[[1,1]]+a[[1,2]]}; s[l_]:={l,{Last[l],First[l]}}; Map[s,Map[u,Map[w,Part[Partition[Tuples[{0,1},n],2^(n-1)],1]]]]]
    Flatten[Append[{1,1},Table[Map[First,sbt[i]],{i,1,6}]]] (* Peter Luschny, Apr 27 2009 *)

Extensions

More terms from Alford Arnold, Sep 11 2000
More terms from Joshua Zucker, May 11 2006

A362160 Irregular triangle read by rows: The n-th row contains 2^n integers corresponding to the words of the n-bit Gray code with the most significant bits changing fastest.

Original entry on oeis.org

0, 0, 1, 0, 2, 3, 1, 0, 4, 6, 2, 3, 7, 5, 1, 0, 8, 12, 4, 6, 14, 10, 2, 3, 11, 15, 7, 5, 13, 9, 1, 0, 16, 24, 8, 12, 28, 20, 4, 6, 22, 30, 14, 10, 26, 18, 2, 3, 19, 27, 11, 15, 31, 23, 7, 5, 21, 29, 13, 9, 25, 17, 1, 0, 32, 48, 16, 24, 56, 40, 8, 12, 44, 60, 28
Offset: 0

Views

Author

Valentin Bakoev, Apr 10 2023

Keywords

Comments

The n-th row of the triangle is defined recursively as row(0) = 0 which corresponds to the empty word, and row(n) = row(n-1)0, row^r(n-1)1, for n > 0. Here row(n-1)0 is the sequence of words of the (n-1)-bit Gray code of this type suffixed with 0, and row^r(n-1)1 means the sequence of reflected words (i.e., words are taken in reverse order) of the (n-1)-bit Gray code of this type and then each word is suffixed with 1.
Another way to obtain row(n) is by applying the transition sequence A001511(n), which indicates which bit to flip in the current word to get the next word - see the FORMULA section.
If we reverse the internal order of bits in each word of row(n), we obtain the binary reflected n-bit Gray code (see A003188) and vice versa.

Examples

			Triangle begins:
    k = 0   1   2  3   4   5   6  7 ...
  n=0:  0,
  n=1:  0,  1,
  n=2:  0,  2,  3, 1,
  n=3:  0,  4,  6, 2,  3,  7,  5, 1,
  n=4:  0,  8, 12, 4,  6, 14, 10, 2, 3, 11, 15, 7, 5, 13, 9, 1,
  n=5:  0, 16, 24, 8, 12, 28, 20, 4, 6, 22, 30, 14, 10, 26, 18, 2, 3, 19, 27, 11, 15, 31, 23, 7, 5, 21, 29, 13, 9, 25, 17, 1,
  ...
In row n=3, the corresponding binary words of length 3 are 000, 100, 110, 010, 011, 111, 101, and 001 - notice that the most significant bits change the fastest.
		

References

  • W. Lipski Jr, Combinatorics for programmers, Mir, Moscow, 1988, (in Russian), p. 31, Algorithm 1.13.
  • F. Ruskey, Combinatorial Generation. Working Version (1j-CSC 425/520), 2003, pp. 120-121.

Crossrefs

Cf. A003188 (Gray code), A006516 (row sums), A000004 (column k=0), A000079 (column k=1), A088208.
T(n,2^n-1) gives A057427.
Cf. also A000120, A005811, A363674.

Programs

  • Maple
    with(ListTools): with(Bits):
    T:= (n, k)-> Join(Reverse(Split(Xor(k, iquo(k, 2)), bits=n))):
    seq(seq(T(n, k), k=0..2^n-1), n=0..6);  # Alois P. Heinz, Jun 05 2023
  • PARI
    T(n,k) = fromdigits(Vecrev(binary(bitxor(k,k>>1)), n), 2); \\ Kevin Ryde, Apr 17 2023

Formula

T(n,k) = 2*T(n-1,k) for 0 <= k < 2^(n-1), and
T(n,2^(n-1)+k) = 2*T(n-1,2^(n-1)-k-1) + 1 = T(n,2^(n-1)-k-1) + 1 for 0 <= k < 2^(n-1).
T(n,k+1) = T(n,k) XOR 2^(n-A001511(k)).
A000120(T(n,n)) = A005811(n). - Alois P. Heinz, Jun 27 2023
T(n, k) = A088208(n, k) - 1. - Andrey Zabolotskiy, Dec 06 2024
Showing 1-6 of 6 results.