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 13 results. Next

A167979 Linearize the arrays A099627 A124922 ... defined in A167204 and based on A161924 then concatenate to form a new table.

Original entry on oeis.org

1, 2, 6, 3, 10, 12, 4, 13, 20, 14, 5, 18, 25, 22, 24, 7, 21, 36, 29, 40, 26, 8, 27, 41, 38, 49, 42, 28, 9, 34, 51, 45, 72, 53, 44, 30, 11, 37, 68, 59, 81, 74, 57, 46, 48, 15, 43, 73, 70, 99, 85, 76, 61, 80, 50, 16, 55, 83, 77, 136, 107, 89, 78, 97, 82, 52
Offset: 1

Views

Author

Alford Arnold, Nov 15 2009

Keywords

Comments

Contribution from Alford Arnold, Nov 29 2009: (Start)
Note that the values within A167977 identify the number partitioned described in A125106 and A161924.
(End)

Examples

			The resulting table begins:
..1..2..3..4..5..7..8
..6.10.13.18.21.27
.12.20.25.36.41
.14.22.29.38
etc.
Contribution from _Alford Arnold_, Nov 29 2009: 4 equals 2+2 which maps to the natural number 6 (binary 110) and 6 appears in the second array (A124922).
		

Crossrefs

Contribution from Alford Arnold, Nov 29 2009: (Start)
A125106(Describes the mapping to partitions). A167977 is A161511(A167979).
(End)

Extensions

Corrected By Alford Arnold, Nov 29 2009

A176575 Second edge diagonal of table A176577. (The first edge diagonal is A099627).

Original entry on oeis.org

1, 10, 36, 42, 136, 146, 170, 292, 528, 546, 586, 682, 1092, 1170, 2080, 2114, 2184, 2186, 2340, 2346, 2730, 4228, 4370, 4706, 8256, 8322, 8456, 8458, 8738, 8740, 8746, 9362, 9386, 10922, 16644, 16912, 16914, 17476, 17482, 18724, 18730, 32896, 33026
Offset: 1

Views

Author

Alford Arnold, May 13 2010

Keywords

Comments

Sequence A176575 can be useful in reconstructing table A176577.
Consider, for example, diagonal 10 18 21 34 37 43 66 69 75 ...
the highest power of two less than 10 is 8 and 10-8 is 2 (the "residual").
Construct the sequence 10,18,34,66,... by doubling each term and subtracting
the residual. The remaining terms are formed by using the rule "2x+1":
10..18..34..66..
21..37..69..
43..75..
87..

Examples

			A176577 begins
1
2...10
3...18...36
4...21...68...42
5...34...73...74..136
7...37..132...85..264..146
so a(n) begins:
1..10..36..42..136..146..
		

Crossrefs

A187769 Triangle read by rows: equivalence classes of natural numbers, where numbers are equivalent when having equal numbers of zeros and ones in binary representation, respectively.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 11, 13, 14, 15, 16, 17, 18, 20, 24, 19, 21, 22, 25, 26, 28, 23, 27, 29, 30, 31, 32, 33, 34, 36, 40, 48, 35, 37, 38, 41, 42, 44, 49, 50, 52, 56, 39, 43, 45, 46, 51, 53, 54, 57, 58, 60, 47, 55, 59, 61, 62, 63, 64, 65, 66
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 05 2013

Keywords

Comments

Row lengths are given by Pascal's triangle (cf. A007318), seen as flattened sequence, or for n > 0: length of n-th row = A007318(A003056(n-1),A002262(n-1));
1 <= i < j <= length of n-th row: A023416(T(n,i)) = A023416(T(n,j)), A000120(T(n,i)) = A000120(T(n,j)) and A070939(T(n,i)) = A070939(T(n,j));
the table provides a permutation of the natural numbers when seen as flattened sequence.
This sequence can be seen as an irregular triangle S(i,k) where row 0 = {1}, row n = { m = 2^(n-1)..2^n - 1 } sorted according to omega(A019565(m)), where omega = A001221. Under this arrangement, the rows can be further subdivided into segments of m with the same omega(m), which align with the original definition's triangle T. - Michael De Vlieger, Jan 03 2025

Examples

			See link.
		

Crossrefs

Rows of A187786, duplicates removed;
Cf. A099627 (left edge), A023758 (right edge).

Programs

  • Haskell
    import List (elemIndices)
    a187769 n k = a187769_tabf !! n !! k
    a187769_row n = a187769_tabf !! n
    a187769_tabf = [0] : [elemIndices (b, len - b) $
       takeWhile ((<= len) . uncurry (+)) $ zip a000120_list a023416_list |
       len <- [1 ..], b <- [1 .. len]]
    a187769_list = concat a187769_tabf
  • Mathematica
    {{0}}~Join~Table[SortBy[Range[2^n, 2^(n + 1) - 1], DigitCount[#, 2, 1] &], {n, 0, 8}] // Flatten (* Michael De Vlieger, Jan 03 2025 *)

A073137 a(n) is the least number whose binary representation has the same number of 0's and 1's as n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 5, 7, 8, 9, 9, 11, 9, 11, 11, 15, 16, 17, 17, 19, 17, 19, 19, 23, 17, 19, 19, 23, 19, 23, 23, 31, 32, 33, 33, 35, 33, 35, 35, 39, 33, 35, 35, 39, 35, 39, 39, 47, 33, 35, 35, 39, 35, 39, 39, 47, 35, 39, 39, 47, 39, 47, 47, 63, 64, 65, 65, 67, 65, 67, 67, 71, 65
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 16 2002

Keywords

Comments

A023416(a(n)) = A023416(n), A000120(a(n)) = A000120(n).
Fixed points are { 0 } union { A099627 }. - Alois P. Heinz, Jan 30 2025

Examples

			a(20)=17, as 20='10100' and 17 is the smallest number having two 1's and three 0's: 17='10001', 18='10010', 20='10100' and 24='11000'.
		

Crossrefs

Programs

  • Maple
    a:= n-> (l-> (2^nops(l)+2^add(i, i=l))/2-1)(Bits[Split](n)):
    seq(a(n), n=0..100);  # Alois P. Heinz, Jun 26 2021
  • Mathematica
    lnb[n_]:=Module[{sidn=Sort[IntegerDigits[n,2]]},FromDigits[Join[{1}, Most[ sidn]],2]]; Join[{0},Array[lnb,80]] (* Harvey P. Dale, Aug 04 2014 *)
  • PARI
    a(n) = if(n==0,0, 1<Kevin Ryde, Jun 26 2021
  • Python
    def a(n):
        b = bin(n)[2:]; z = b.count('0'); w = len(b) - z
        return int('1'*(w > 0) + '0'*z + '1'*(w-1), 2)
    print([a(n) for n in range(73)]) # Michael S. Branicky, Jun 26 2021
    
  • Python
    def a(n): b = bin(n)[2:]; return int(b[0] + "".join(sorted(b[1:])), 2)
    print([a(n) for n in range(73)]) # Michael S. Branicky, Jun 26 2021
    

Formula

a(0)=0, a(1)=1; for n > 1, let C = 2^(floor(log_2(n))-1) = A072376(n); then a(n) = a(n-C) + C if n < 3*C; otherwise a(n) = 2*a(n - 2*C) + 1. [corrected by Jon E. Schoenfield, Jun 27 2021]
For n > 0: a(n) = (2^(A000120(n) - 1)) * (2^A023416(n) + 1) - 1. - Corrected by Michel Marcus, Nov 15 2013

A324495 Average number of steps t(n) required to get n by repeatedly toggling one of the ceiling(log_2(n)) bits of the binary result of the previous step at a random position with equal probability of the bit positions, starting with all bits 0. The fractional part of t is given separately, i.e., t(n) = a(n) + A324496(n)/A324497(n).

Original entry on oeis.org

1, 3, 4, 7, 9, 9, 10, 15, 18, 18, 20, 18, 20, 20, 21, 31, 37, 37, 40, 37, 40, 40, 41, 37, 40, 40, 41, 40, 41, 41, 42, 63, 74, 74, 78, 74, 78, 78, 80, 74, 78, 78, 80, 78, 80, 80, 82, 74, 78, 78, 80, 78, 80, 80, 82, 78, 80, 80, 82, 80, 82, 82, 83, 127, 147, 147, 153
Offset: 1

Views

Author

Hugo Pfoertner, Mar 05 2019

Keywords

Comments

The problem is related to random walks on the edges of n-dimensional hypercubes.
a(n) is only dependent on the length of the binary representation A070939(n) and on the binary weight A000120(n).

Examples

			a(5) = 9 is given by the sum of occurrence probabilities of toggle chains of even lengths 2*k, multiplied by the lengths.
a(5) = Sum_{k>=1} 4*k*7^(k-1) / 3^(2*k) = 9.
The corresponding simulation results for 10^10 toggle chains are
  2*k Probability P    2*k*P      Cumulated
    2   0.22222334  0.44444668    0.444447
    4   0.17284183  0.69136731    1.135814
    6   0.13442963  0.80657780    1.942392
    8   0.10455718  0.83645746    2.778849
   10   0.08131600  0.81315998    3.592009
   ...
  196   0.00000000  0.00000002    9.000068
.
a(7) = Sum_{k>=1} 2*(2*k+1)*7^(k-1) / 3^(2*k) = 10.
		

Crossrefs

A099628 Numbers m where m-th Catalan number A000108(m) = binomial(2m,m)/(m+1) is divisible by 2 but not by 4, i.e., where A048881(m) = 1.

Original entry on oeis.org

2, 4, 5, 8, 9, 11, 16, 17, 19, 23, 32, 33, 35, 39, 47, 64, 65, 67, 71, 79, 95, 128, 129, 131, 135, 143, 159, 191, 256, 257, 259, 263, 271, 287, 319, 383, 512, 513, 515, 519, 527, 543, 575, 639, 767, 1024, 1025, 1027, 1031, 1039, 1055, 1087, 1151, 1279, 1535, 2048
Offset: 1

Views

Author

Henry Bottomley, Oct 25 2004

Keywords

Comments

Also, there is exactly one digit position in which both a(n)+1 and a(n)-1, written in binary, have a 1; i.e., the bitwise AND of a(n)-1 and a(n)+1 is 2^k, with k > 0. - Wouter Meeussen, Nov 24 2007

Examples

			As triangle, rows start
   2;
   4,  5;
   8,  9, 11;
  16, 17, 19, 23;
  32, 33, 35, 39, 47;
  ...
5 is in the sequence since 10!/(5!6!) = 42 is divisible by 2 but not 4;
6 is not in the sequence since 12!/(6!7!) = 132 is divisible by 4;
7 is not in the sequence since 14!/(7!8!) = 429 is not divisible by 2.
From _Michael De Vlieger_, Dec 28 2022: (Start)
Table showing the binary expansion of a(n) for n = 1..15, replacing 0 with "." to accentuate the pattern of bits:
   n  a(n)  a(n)_2
  ----------------
   1    2       1.
   2    4      1..
   3    5      1.1
   4    8     1...
   5    9     1..1
   6   11     1.11
   7   16    1....
   8   17    1...1
   9   19    1..11
  10   23    1.111
  11   32   1.....
  12   33   1....1
  13   35   1...11
  14   39   1..111
  15   47   1.1111 (End)
		

Crossrefs

Programs

  • Magma
    /* As triangle */ [[2^(n+1) + 2^k - 1: k in [0..n]]: n in [0.. 15]]; // Vincenzo Librandi, Jul 27 2017
    
  • Mathematica
    Select[Range[2048],IntegerQ[Log[2,BitAnd[ #+1,#-1]]]&] (* Wouter Meeussen, Nov 24 2007 *)
    Table[2^(n + 1) + 2^k - 1, {n, 0, 10}, {k, 0, n}] // Flatten (* Michael De Vlieger, Dec 28 2022 *)
    Select[Range[2100],Boole[Divisible[CatalanNumber[#],{2,4}]]=={1,0}&] (* Harvey P. Dale, Jan 31 2024 *)
  • Python
    from itertools import count, islice
    def A099628_gen(): # generator of terms
        m = 1
        for n in count(1):
            m *= 2
            r, k = m-1,1
            for _ in range(n):
                yield r+k
                k *= 2
    A099628_list = list(islice(A099628_gen(),40)) # Chai Wah Wu, Nov 15 2022

Formula

As triangle, T(n,k) = 2^(n+1) + 2^k - 1 = A099627(n+1, k).

Extensions

Offset changed to 1 by N. J. A. Sloane, Jul 27 2017

A124922 Second in a series of triangular arrays providing index numbers for subsequences of A060351.

Original entry on oeis.org

6, 10, 13, 18, 21, 27, 34, 37, 43, 55, 66, 69, 75, 87, 111, 130, 133, 139, 151, 175, 223
Offset: 1

Views

Author

Alford Arnold, Nov 21 2006

Keywords

Comments

The first triangular array is A099627 which provides index numbers in A060351 for Pascal's Triangle (A007318). This second array provides the index numbers in A060351 for array A059797.
Note that this table and A099627 are sub-arrays of table A161924 which has A000041 entries per row. - Alford Arnold, Oct 19 2009

Examples

			A060351(34,37,43,55) = (14,35,35,14) = Row Four of Array A059797.
		

Crossrefs

Extensions

I would like a clearer definition of this and other recent triangles from this author. - N. J. A. Sloane, Nov 22 2006
More terms from Alford Arnold, Oct 19 2009

A197818 Walsh matrix antidiagonals converted to decimal.

Original entry on oeis.org

1, 3, 5, 15, 17, 51, 93, 255, 257, 771, 1453, 3855, 4593, 13299, 23901, 65535, 65537, 196611, 371373, 983055, 1175281, 3394803, 6103645, 16711935, 16908033, 50593539, 95245741, 252706575, 301011441, 871576563, 1566432605, 4294967295
Offset: 0

Views

Author

Tilman Piesk, Oct 18 2011

Keywords

Comments

Infinite Walsh matrix with the negative ones replaced by zeros (negated binary Walsh matrix), the antidiagonals read as binary numbers.
This sequence is similar to A001317 (Sierpinski triangle rows converted to decimal). a(n) = A001317(n) iff n=0 or n is an element of A099627.

Examples

			Top left corner of the negated binary Walsh matrix:
1 1 1 1 1 1 1 1
1 0 1 0 1 0 1 0
1 1 0 0 1 1 0 0
1 0 0 1 1 0 0 1
1 1 1 1 0 0 0 0
1 0 1 0 0 1 0 1
1 1 0 0 0 0 1 1
1 0 0 1 0 1 1 0
The antidiagonals in binary and decimal are:
         1 =   1
        11 =   3
       101 =   5
      1111 =  15
     10001 =  17
    110011 =  51
   1011101 =  93
  11111111 = 255
		

Crossrefs

Programs

  • PARI
    N=2^5;  /* a power of 2 */
    parity(x)= {
        my(s=1);
        while ( (x>>s),  x=bitxor(x, x>>s); s+=s; );
        return( bitand(x,1) );
    }
    W = matrix(N,N, i,j, if(parity(bitand(i-1,j-1)),0,1); );
    a(n) = sum(k=0,n, 2^k * W[n-k+1,k+1] );
    vector(N,n,a(n-1))
    /* Joerg Arndt, Mar 27 2013 */

A167201 Third in a series of triangular subarrays of A117506. Previous arrays are Tables A007318 and A059797.

Original entry on oeis.org

5, 14, 21, 28, 70, 56, 48, 162, 216, 120
Offset: 1

Views

Author

Alford Arnold, Nov 02 2009

Keywords

Comments

This subarray is generated from values related to the source partition 3+3. (cf A161924).

Examples

			The domain values begin:
12
20..25
36..41..51
68..73..83..103
so based on function A117506, a(n) begins:
5
14..21
28..70..56
48..162..216..120
Note that A117506(22) maps to Partition 3+3
which corresponds to the 12th natural number appearing in A161924.
		

Crossrefs

A167202 Fourth in a series of triangular subarrays of A117506. Previous arrays are Tables A007318, A059797 and A167201.

Original entry on oeis.org

5, 21, 14, 56, 70, 28, 120, 216, 162, 48
Offset: 1

Views

Author

Alford Arnold, Nov 04 2009

Keywords

Comments

This subarray is generated from values related to the source partition
2+2+2. (cf A161924). Note that A117506(25) maps to Partition 2+2+2
which corresponds to the 14th natural number appearing in A161924.
Note also that Table A167201 is the transpose of Table a(n) and that
partition 3+3 is the conjugate of partition 2+2+2.

Examples

			The A161924 domain values begin:
14
22..29
38..45..59
70..77..91..119
so based on function A117506, a(n) begins:
5
21..14
56..70..28
70..77..91..119
		

Crossrefs

Showing 1-10 of 13 results. Next