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-10 of 11 results. Next

A049776 Triangular array T read by rows: n-th row consists of fixed points, k, of n-th row of array t given by A049773; i.e., t(n, t(n,k)) = t(n,k).

Original entry on oeis.org

1, 1, 2, 1, 4, 1, 3, 6, 8, 1, 7, 10, 16, 1, 5, 11, 15, 18, 22, 28, 32, 1, 13, 19, 31, 34, 46, 52, 64, 1, 9, 21, 29, 35, 43, 55, 63, 66, 74, 86, 94, 100, 108, 120, 128, 1, 25, 37, 61, 67, 91, 103, 127, 130, 154, 166, 190, 196, 220, 232, 256
Offset: 1

Views

Author

Keywords

Examples

			Rows: {1}; {1,2}; {1,4}; {1,3,6,8}; ...
		

A007582 a(n) = 2^(n-1)*(1+2^n).

Original entry on oeis.org

1, 3, 10, 36, 136, 528, 2080, 8256, 32896, 131328, 524800, 2098176, 8390656, 33558528, 134225920, 536887296, 2147516416, 8590000128, 34359869440, 137439215616, 549756338176, 2199024304128, 8796095119360, 35184376283136, 140737496743936, 562949970198528
Offset: 0

Views

Author

Keywords

Comments

Let G_n be the elementary Abelian group G_n = (C_2)^n for n >= 1: A006516 is the number of times the number -1 appears in the character table of G_n and A007582 is the number of times the number 1. Together the two sequences cover all the values in the table, i.e., A006516(n) + A007582(n) = 2^(2n). - Ahmed Fares (ahmedfares(AT)my-deja.com), Jun 01 2001
Number of walks of length 2n+1 between two adjacent vertices in the cycle graph C_8. Example: a(1)=3 because in the cycle ABCDEFGH we have three walks of length 3 between A and B: ABAB, ABCB and AHAB. - Emeric Deutsch, Apr 01 2004
Smallest number containing in its binary representation two equal non-overlapping subwords of length n: A097295(a(n))=n and A097295(m)Reinhard Zumkeller, Aug 04 2004
a(n)^2 + (A006516(n))^2 = a(2n). E.g., a(3) = 36, A006516(3) = 28, a(6) = 2080. 36^2 + 28^2 = 2080. - Gary W. Adamson, Jun 17 2006
Let P(A) be the power set of an n-element set A. Then a(n) = the number of pairs of elements {x,y} of P(A) for which either x equals y or x does not equal y. - Ross La Haye, Jan 02 2008
Let P(A) be the power set of an n-element set A. Then a(n) = the number of pairs of elements {x,y} of P(A). This is just a simpler statement of my previous comment for this sequence. - Ross La Haye, Jan 10 2008
For n>0: A000120(a(n))=2, A023414(a(n))=2*(n-1), A087117(a(n))=n-1. - Reinhard Zumkeller, Jun 23 2009
a(n+1) written in base 2: 11, 1010, 100100, 10001000, 1000010000, ..., i.e., number 1, n times 0, number 1, n times 0 (A163449(n)). - Jaroslav Krizek, Jul 27 2009
a(n) for n >= 1 is a bisection of A001445(n+1). - Jaroslav Krizek, Aug 14 2009
Related to A102573: letting T(q,r) be the coefficient of n^(r+1) in the polynomial 2^(q-n)/n times sum_{k=0..n} binomial(n,k)*k^q, then A007582(x)= sum_{k=0..x-1} T(x,k)*2^k. - John M. Campbell, Nov 16 2011
a(n) gives the number of pairs (r, s) such that 0 <= r <= s <= (2^n)-1 that satisfy AND(r, s, XOR(r, s)) = 0. - Ramasamy Chandramouli, Aug 30 2012
a(n) = A000217(2^n) = 2^(2n-1) + 2^(n-1) is the nearest triangular number above 2^(2n-1); cf. A006516, A233327. - Antti Karttunen, Feb 26 2014
Consider the quantum spin-1/2 chain with even number of sites L (physics, condensed matter theory). The spectrum of the Hamiltonian can be classified according to symmetries. If the only symmetry of the spin Hamiltonian is Parity, i.e., reflection with respect to the middle of the chain (see e.g. the transverse-field Ising model with open boundary conditions), then the dimension of the p=+1 parity sector is given by a(n) with n=L/2. - Marin Bukov, Mar 11 2016
a(n) is also the total number of words of length n, over an alphabet of four letters, of which one of them appears an even number of times. See the Lekraj Beedassy, Jul 22 2003, comment on A006516 (4-letter odd case), and the Balakrishnan reference there. For the 1- to 11-letter cases, see the crossrefs. - Wolfdieter Lang, Jul 17 2017
a(n) is the number of nonisomorphic spanning trees of the cyclic snake formed with n+1 copies of the cycle on 4 vertices. A cyclic snake is a connected graph whose block-cutpoint is a path and all its n blocks are isomorphic to the cycle C_m. - Christian Barrientos, Sep 05 2024
Also, with offset 1, the cogrowth sequence of the dihedral group with 16 elements, D8 = . - Sean A. Irvine, Nov 06 2024

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A006516.
Cf. A134308.
Cf. A102573.
The number of words of length n with m letters, one of them appearing an even number of times is for m = 1..11: A000035, A011782, A007051, A007582, A081186, A081187, A081188, A081189, A081190, A060531, A081192. - Wolfdieter Lang, Jul 17 2017

Programs

  • Magma
    [Binomial(2^n + 1, 2) : n in [0..30]]; // Wesley Ivan Hurt, Jul 03 2020
  • Maple
    seq(binomial(-2^n, 2), n=0..23); # Zerinvary Lajos, Feb 22 2008
  • Mathematica
    Table[ Binomial[2^n + 1, 2], {n, 0, 23}] (* Robert G. Wilson v, Jul 30 2004 *)
    LinearRecurrence[{6,-8},{1,3},30] (* Harvey P. Dale, Apr 08 2013 *)
  • Maxima
    A007582(n):=2^(n-1)*(1+2^n)$ makelist(A007582(n),n,0,30); /* Martin Ettl, Nov 15 2012 */
    
  • PARI
    a(n)=if(n<0,0,2^(n-1)*(1+2^n))
    
  • PARI
    a(n)=sum(k=-n\4,n\4,binomial(2*n+1,n+1+4*k))
    

Formula

G.f.: (1-3*x)/((1-2*x)*(1-4*x)). C(1+2^n, 2) where C(n, 2) is n-th triangular number A000217.
Binomial transform of A007051. Inverse binomial transform of A081186. - Paul Barry, Apr 07 2003
E.g.f.: exp(3*x)*cosh(x). - Paul Barry, Apr 07 2003
a(n) = Sum_{k=0..floor(n/2)} C(n, 2*k)*3^(n-2*k). - Paul Barry, May 08 2003
a(n+1) = 4*a(n) - 2^n; see also A049775. a(n) = 2^(n-1)*A000051(n). - Philippe Deléham, Feb 20 2004
a(n) = 6*a(n-1) - 8*a(n-2). - Emeric Deutsch, Apr 01 2004
Row sums of triangle A134308. - Gary W. Adamson, Oct 19 2007
a(n) = StirlingS2(2^n + 1,2^n) = 1 + 2*StirlingS2(n+1,2) + 3*StirlingS2(n+1,3) + 3*StirlingS2(n+1,4) = StirlingS2(n+2,2) + 3(StirlingS2(n+1,3) + StirlingS2(n+1,4)). - Ross La Haye, Mar 01 2008
a(n) = StirlingS2(2^n + 1,2^n) = 1 + 2*StirlingS2(n+1,2) + 3*StirlingS2(n+1,3) + 3*StirlingS2(n+1,4) = StirlingS2(n+2,2) + 3(StirlingS2(n+1,3) + StirlingS2(n+1,4)). - Ross La Haye, Apr 02 2008
a(n) = A000079(n) + A006516(n). - Yosu Yurramendi, Aug 06 2008
a(n) = A028403(n+1) / 4. - Jaroslav Krizek, Jul 27 2009
a(n) = Sum_{k=-floor(n/4)..floor(n/4)} binomial(2*n,n+4*k)/2. - Mircea Merca, Jan 28 2012
G.f.: Q(0)/2 where Q(k) = 1 + 2^k/(1 - 2*x/(2*x + 2^k/Q(k+1) )); (continued fraction ). - Sergei N. Gladkovskii, Apr 10 2013
a(n) = Sum_{k=1..2^n} k. - Joerg Arndt, Sep 01 2013
a(n) = (1/3) * Sum_{k=2^n..2^(n+1)} k. - J. M. Bergot, Jan 26 2015
a(n+1) = 2*a(n) + 4^n. - Yuchun Ji, Mar 10 2017

A030109 Write n in binary, reverse bits, subtract 1, divide by 2.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The sequence divides naturally into blocks of length 2^k, k = 0, 1, 2, ... On block k, let n go from 0 to 2^k-1, write n in binary using k bits and reverse the bits. - N. J. A. Sloane, Jun 11 2002
For example: the 3-bit strings are 000, 001, 010, 011, 100, 101, 110 and 111. When they are bit-reversed, we get 000, 100, 010, 110, 001, 101, 011, 111. Or, in decimal representation 0,4,2,6,1,5,3,7.
In other words: Given any n>1, the set of numbers A030109[i] for indexes i ranging from 2^n to 2^(n+1)-1 is a permutation of the set of consecutive integers {0,1,2,...,2^n-1}. Example: for n=2, we have the permutation of {0,2,1,3} of {0,1,2,3} This is important in the standard FFT algorithms requiring a starting (or ending) bit-reversal permutation of indices. - Stanislav Sykora, Mar 15 2012

Examples

			As an irregular triangle, first few rows are:
  0;
  0,1;
  0,2,1,3;
  0,4,2,6,1,5,3,7;
  0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15;
  ...
		

Crossrefs

Cf. A030101. A049773 is another version.

Programs

  • Haskell
    a030109 = flip div 2 . subtract 1 . a030101
    -- Reinhard Zumkeller, Mar 14 2015
    
  • MATLAB
    % To get the irregular triangle
    function T = ITriang(rows)
      T = cell(rows, 1);
      T{1} = [0];
      for r = 1:rows - 1;
        T{r + 1} = [2*T{r} (2*T{r} + 1)];
      end
    end
    % Miguel Vargas, May 04 2024
  • Maple
    a:= proc(n) option remember; local r; `if`(n<3, 0,
          `if`(irem(n, 2, 'r')=0, a(r), a(r) +2^ilog2(r)))
        end:
    seq(a(n), n=1..127);  # Alois P. Heinz, Oct 08 2012
  • Mathematica
    Table[(FromDigits[Reverse[IntegerDigits[n,2]],2]-1)/2,{n,90}] (* Harvey P. Dale, Oct 26 2013 *)
  • PARI
    a(n) = (fromdigits(Vecrev(binary(n)), 2) - 1)/2; \\ Michel Marcus, Oct 01 2019
    
  • R
    maxrow <- 10 # by choice
    a <- 0
    for(m in 0:maxrow) for(k in 0:(2^m-1)) {
      a[2^(m+1)+    k] <- 2*a[2^m+k]
      a[2^(m+1)+2^m+k] <-   a[2^(m+1)+k]+1
    }
    a
    # Yosu Yurramendi, Jan 24 2015
    

Formula

a(n) = A059893(n) - A053644(n). If 2*2^k<= n<3*2^k then a(n) = 2*a(n-2^k); if 3*2^k<= n<4*2^k then a(n) = 1+ a(n-2^k) starting with a(1) = 0. - Henry Bottomley, Sep 13 2001
a(2n) = a(n), a(2n+1) = a(n) + 2^[log_2(n)]. - Ralf Stephan, Aug 22 2003
a(2^m*(2*A072758(n)+1)) = n for m and n >= 0. - Yosu Yurramendi, Jan 24 2015

Extensions

More terms from Patrick De Geest, Jun 15 1998

A049775 a(n) is the sum of all integers from 2^(n-2)+1 to 2^(n-1).

Original entry on oeis.org

2, 7, 26, 100, 392, 1552, 6176, 24640, 98432, 393472, 1573376, 6292480, 25167872, 100667392, 402661376, 1610629120, 6442483712, 25769869312, 103079346176, 412317122560, 1649267965952, 6597070815232, 26388281163776
Offset: 2

Views

Author

Keywords

Comments

Name when submitted: Sum of even-indexed terms of n-th row of array T given by A049773 (from Clark Kimberling).
Also sum of integers of which the binary order [A029837] is n: a(n) = Sum_[x | ceiling(log_2(x)) = n ]. E.g., a(7) = 6176 = Apply[Plus, Table[w,{w,65,128}]].
This sequence may be obtained by filling a complete binary tree left-to-right, row by row with the integers onwards from 2 and then collecting the sums of the rows; e.g., 2, 3+4, 5+6+7+8, 9+10+11+12+13+14+15+16, etc. a(n) is then equal to the sum of row n-1. - Carl R. White, Aug 19 2003
If the offset is set to zero, the inverse binomial transform gives A007051 without its leading 1. - R. J. Mathar, Mar 26 2009

Examples

			a(2) = 2 = 2.
a(3) = 7 = 3 + 4.
a(4) =26 = 5 + 6 + 7 + 8.
..
		

Crossrefs

Cf. A049773 (sequence motivating the original definition).
Cf. A049775(n+2) = A007582(n+1) - A007582(n).

Programs

  • Mathematica
    LinearRecurrence[{6,-8},{2,7},30] (* Harvey P. Dale, Mar 04 2013 *)

Formula

a(n) = 2^(n-3)*(3*2^(n-2)+1). - Carl R. White, Aug 19 2003
From Philippe Deléham, Feb 20 2004: (Start)
a(n+1) = 4*a(n) - 2^(n-2); see also A007582.
a(n+1) = 2^(n-2)*A004119(n). (End)
From R. J. Mathar, Mar 26 2009: (Start)
a(n) = 6*a(n-1) - 8*a(n-2).
G.f.: -x^2*(-2+5*x)/((4*x-1)*(2*x-1)). (End)

Extensions

More terms from Michael Somos
Name change by Olivier Gérard, Oct 24 2017

A088208 Table read by rows where T(0,0)=1; n-th row has 2^n terms T(n,j),j=0 to 2^n-1. For j==0 mod 2, T(n+1,2j)=T(n,j) and T(n+1,2j+1)=T(n,j)+2^n. For j==1 mod 2, T(n+1,2j+1)=T(n,j) and T(n+1,2j)=T(n,j)+2^n.

Original entry on oeis.org

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

Views

Author

Gary W. Adamson, Sep 23 2003

Keywords

Comments

Schroeder, p. 281 states "The ordering with which the iterates x_n fall into the 2^m different chaos bands [order as to magnitude] is also the same as the ordering of the iterates in a stable orbit of period length P = 2^m. For example, for both the period-4 orbit and the four chaos bands, the iterates, starting with the largest iterate x_1, are ordered as follows: x_1 > x_3 > x_4 > x_2."
From Andrey Zabolotskiy, Dec 06 2024: (Start)
For n>0, row n-1 is the permutation relating row n of the left half of Stern-Brocot tree with row n of Kepler's tree of fractions. 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 SB_n(k) = K_n(T(n-1, k)).
The inverse permutation is row n of A131271.
Equals A362160+1. (End)

Examples

			1
1 2
1 3 4 2
1 5 7 3 4 8 6 2
1 9 13 5 7 15 11 3 4 12 16 8 6 14 10 2
		

References

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

Crossrefs

Programs

  • Haskell
    a088208 n k = a088208_tabf !! (n-1) !! (k-1)
    a088208_row n = a088208_tabf !! (n-1)
    a088208_tabf = iterate f [1] where
       f vs = (map (subtract 1) ws) ++ reverse ws where ws = map (* 2) vs
    -- Reinhard Zumkeller, Mar 14 2015
  • Mathematica
    nmax = 6;
    T[, 0] = 1; T[n, j_] /; j == 2^n = n;
    Do[Which[
      EvenQ[j], T[n+1, 2j] = T[n, j]; T[n+1, 2j+1] = T[n, j] + 2^n,
      OddQ[j], T[n+1, 2j+1] = T[n, j]; T[n+1, 2j] = T[n, j] + 2^n],
    {n, 0, nmax}, {j, 0, 2^n-1}];
    Table[T[n, j], {n, 0, nmax}, {j, 0, 2^n-1}] // Flatten (* Jean-François Alcover, Aug 03 2018 *)

Extensions

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

A088370 Triangle T(n,k), read by rows, where the n-th row is a binary arrangement of the numbers 1 through n.

Original entry on oeis.org

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

Views

Author

Paul D. Hanna, Sep 28 2003

Keywords

Comments

The n-th row differs from the prior row only by the presence of n. See A088371 for the positions in the n-th row that n is inserted.
From Clark Kimberling, Aug 02 2007: (Start)
At A131966, this sequence is cited as the fractal sequence of the Cantor set C.
Recall that C is the set of fractions in [0,1] whose base 3 representation consists solely of 0's and 2's.
Arrange these fractions as follows:
0
0, .2
0, .02, .2
0, .02, .2, .22
0, .002, .02, .2, .22, etc.
Replace each number x by its order of appearance, counting each distinct predecessor of x only once, getting
1;
1, 2;
1, 3, 2;
1, 3, 2, 4;
1, 5, 3, 2, 4;
Concatenate these to get the current sequence, which is a fractal sequence as defined in "Fractal sequences and interspersions".
One property of such a sequence is that it properly contains itself as a subsequence (infinitely many times). (End)
Row n contains one of A003407(n) non-averaging permutations of [n], i.e., a permutation of [n] without 3-term arithmetic progressions. - Alois P. Heinz, Dec 05 2017

Examples

			Row 5 is formed from row 3, {1,3,2} and row 2, {1,2}, like so:
{1,5,3, 2,4} = {1*2-1, 3*2-1, 2*2-1} | {1*2, 2*2}.
Triangle begins:
  1;
  1,  2;
  1,  3, 2;
  1,  3, 2,  4;
  1,  5, 3,  2,  4;
  1,  5, 3,  2,  6,  4;
  1,  5, 3,  7,  2,  6,  4;
  1,  5, 3,  7,  2,  6,  4,  8;
  1,  9, 5,  3,  7,  2,  6,  4,  8;
  1,  9, 5,  3,  7,  2, 10,  6,  4,  8;
  1,  9, 5,  3, 11,  7,  2, 10,  6,  4,  8;
  1,  9, 5,  3, 11,  7,  2, 10,  6,  4, 12,  8;
  1,  9, 5, 13,  3, 11,  7,  2, 10,  6,  4, 12,  8;
  1,  9, 5, 13,  3, 11,  7,  2, 10,  6, 14,  4, 12,  8;
  1,  9, 5, 13,  3, 11,  7, 15,  2, 10,  6, 14,  4, 12,  8;
  1,  9, 5, 13,  3, 11,  7, 15,  2, 10,  6, 14,  4, 12,  8, 16;
  1, 17, 9,  5, 13,  3, 11,  7, 15,  2, 10,  6, 14,  4, 12,  8, 16;
  ...
		

References

  • Clark Kimberling, "Fractal sequences and interspersions," Ars Combinatoria 45 (1997) 157-168.

Crossrefs

Diagonal gives A053644. Cf. A049773. - Alois P. Heinz, Oct 28 2011

Programs

  • Maple
    T:= proc(n) option remember;
          `if`(n=1, 1, [map(x-> 2*x-1, [T(n-iquo(n,2))])[],
                        map(x-> 2*x,   [T(  iquo(n,2))])[]][])
        end:
    seq(T(n), n=1..20);  # Alois P. Heinz, Oct 28 2011
  • Mathematica
    T[1] = {1}; T[n_] := T[n] = Join[q = Quotient[n, 2]; 2*T[n-q]-1, 2*T[q]]; Table[ T[n], {n, 1, 20}] // Flatten (* Jean-François Alcover, Feb 26 2015, after Alois P. Heinz *)
  • PARI
    {T(n,k) = if(k==0, 1, if(k<=n\2, 2*T(n\2,k) - 1, 2*T((n-1)\2,k-1-n\2) ))}
    for(n=0,20,for(k=0,n,print1(T(n,k),", "));print(""))

Formula

T(n,n) = 2^(floor(log(n)/log(2))). Construction. The 2n-th row is the concatenation of row n, after multiplying each term by 2 and subtracting 1, with row n, after multiplying each term by 2. The (2n-1)-th row is the concatenation of row n, after multiplying each term by 2 and subtracting 1, with row n-1, after multiplying each term by 2.
Sum_{k=1..n} k * A088370(n,k) = A309371(n). - Alois P. Heinz, Jul 26 2019

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

A338209 a(1) = 1, a(n) is the least m not already in the sequence whose binary expansion ends with the binary expansion of the binary weight of a(n-1).

Original entry on oeis.org

1, 3, 2, 5, 6, 10, 14, 7, 11, 15, 4, 9, 18, 22, 19, 23, 12, 26, 27, 20, 30, 28, 31, 13, 35, 39, 36, 34, 38, 43, 44, 47, 21, 51, 52, 55, 29, 60, 68, 42, 59, 37, 63, 46, 76, 67, 71, 84, 75, 92, 100, 79, 45, 108, 116, 124, 53, 132, 50, 83, 140, 87, 61, 69, 91, 77
Offset: 1

Views

Author

Michael De Vlieger, Dec 16 2020

Keywords

Comments

Define binary weight wt(n) as A000120(n), the number of 1s in the binary expansion of n. Let w = A000120(a(n-1)) the binary weight of the previous term. In other words, a(n) is the least m not already in the sequence such that m mod 2^k = w, where k = floor(1 + log_2 w).
Likely a permutation of the natural numbers.
The numbers m = 2^k with 0 <= k <= 3 appear at indices {1, 3, 11, 222}. The term 16 has not appeared for n <= 2^14 and may not until n approaches 2^16.
The numbers m = (2^k + 1) appear at indices {2, 4, 12, 223, ...}. The numbers m = 2^k or (2^k + 1) require n approximately equal to 2^m in order to appear in the sequence.
The numbers m = (2^k - 1) with 1 <= k <= 14 appear at indices {1, 2, 8, 10, 23, 43, 130, 278, 447, 758, 1390, 2525, 4719, 9333}, respectively.
The plot exhibits dendritic streams of residues r (mod 2^k). We can identify coordinates (x, y) = (n, a(n)) on the plot where the streams branch.
The branches of the tree in the plot contain m congruent to r (mod 2^k), where r is a term (except the last term) in row (k-1) of A049773.
Given 2^14 terms of this sequence, we see 2 or 3 successive invocations of w, otherwise, w appears just once before a different value succeeds it in the next term.
2^4 appears at index 47201. - Michael S. Branicky, Dec 16 2020
A permutation of the integers since n appears at or before index 2^n - 1, the first number with binary weight n. - Michael S. Branicky, Dec 16 2020

Examples

			a(2) = 3 since the binary weight of 1 is 1, and 3 = 1 (mod 2^1).
a(3) = 2 since wt(3) = 2, and 2 = 2 (mod 2^2).
a(4) = 5 since wt(2) = 1, 5 = 1 (mod 2^1), etc.
		

Crossrefs

Programs

  • Mathematica
    Nest[Append[#, Block[{k = 1, r = DigitCount[#[[-1]], 2, 1], s}, s = IntegerLength[r, 2]; While[Nand[FreeQ[#, k], Mod[k, 2^s] == r], k++]; k]] & @@ {#, Length@ #} &, {1}, 2^7]
  • Python
    def aupto(n):
      alst, used = [1], {1}
      for i in range(2, n+1):
        binprev = bin(alst[-1])[2:]
        binwt = binprev.count("1")
        pow2 = 2**(len(bin(binwt))-2)
        while binwt in used: binwt += pow2
        alst.append(binwt); used.add(binwt)
      return alst    # use alst[n-1] for a(n)
    print(aupto(66)) # Michael S. Branicky, Dec 16 2020

A115025 a(n) = n-th element of n-th row of triangle shown below.

Original entry on oeis.org

1, 2, 2, 7, 3, 21, 25, 113, 17, 289, 321, 1665, 769, 5633, 7169, 30721, 2049, 69633, 73729, 409601, 163841, 1376257, 1703937, 7602177, 1572865, 19922945, 23068673, 113246209, 58720257, 385875969, 503316481, 2080374785, 67108865, 4429185025, 4563402753
Offset: 1

Views

Author

Jonas Wallgren, Feb 24 2006

Keywords

Comments

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
...

Crossrefs

Cf. A049773.

Extensions

Offset changed to 1 by Alois P. Heinz, Feb 26 2015
a(16)-a(35) from Alois P. Heinz, Feb 26 2015

A281589 Triangular array T(n,k), n > 0 and k = 1..2^(n-1), read by rows, in which row n corresponds to the permutation of [1..2^(n-1)] resulting from folding a horizontal strip of paper, with 2^(n-1) square cells numbered from 1 to 2^(n-1), n-1 times.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Apr 14 2017

Keywords

Comments

To obtain row n (with n > 0):
- take a strip of paper of dimensions 2^(n-1) X 1
- number the square cells from left to right from 1 to 2^(n-1)
- fold this strip of paper n-1 times, in the middle, covering the left part with the right part; at the end all the cells are stacked on the cell with the number 1
- read the numbers written on square cells from bottom to top.
For n > 0:
- T(n,1) = 1 (the first cell always stays at the bottom)
- T(n+1,2) = 2^n (the last cell covers the first cell after the first folding)
- T(n+1,2^n) = 2 (the second cell comes on top after the last folding).
For n > 0 and k=1..2^(n-2):
- T(n+1,2*k-1) + T(n+1,2*k) = 2^n+1 (opposite cells (summing to 2^n+1) are paired after the first folding).
This sequence has similarities with A049773: here we fold in the middle; there we cut in the middle, covering the left part with the right part.

Crossrefs

Cf. A049773.

Programs

  • PARI
    t(n,k) = my (w=1); my (h=2^(n-1)); my (x=1); my (y=k); while (h>1 && y>1, h /= 2; w *= 2; if (y>h, y = 2*h-y+1; x = w-x+1)); return (x)

Formula

From Jeffrey Shallit, Sep 04 2021: (Start)
a(n) satisfies the recurrences:
a(4n) = a(2n);
a(4n+2) = a(2n) - a(2n+1) + a(4n+1);
a(4n+3) = a(2n+1);
a(8n+1) = -2a(2n+1) + 3*a(4n+1);
a(8n+5) = -a(2n+1) + 2*a(4n+1).
So it is a 2-regular sequence. (End)
From Michel Dekking, Jan 22 2022: (Start)
For n>1 let sigma_n be the uniform morphism of length 2 given by
sigma_n(2j) = 2^n + 1-2j, 2j, for j=1..2^(n-2),
sigma_n(2j+1) = 2j+1, 2^n -2j, for j=0..2^(n-2)-1.
Let T(n,.) be the n-th row of the array T. Then
sigma_n(T(n,.)) = T(n+1,.).
This implies in particular that (a(n)) is a 2-regular sequence. (End)
Showing 1-10 of 11 results. Next