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.

A076478 The binary Champernowne sequence: concatenate binary vectors of lengths 1, 2, 3, ... in numerical order.

Original entry on oeis.org

0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

N. J. A. Sloane, Nov 10 2002

Keywords

Comments

Can also be seen as triangle where row n contains all binary vectors of length n+1. - Reinhard Zumkeller, Aug 18 2015
From Clark Kimberling, Jul 18 2021: (Start)
In the following list, W represents the sequence of words w(n) represented by A076478. The list includes five partitions and two self-inverse permutations of the positive integers.
length of w(n): A000523
positions in W of words w(n) such that # 0's = # 1's: A258410;
positions in W of words w(n) such that # 0's < # 1's: A346299;
positions in W of words w(n) such that # 0's > # 1's: A346300;
positions in W of words w(n) that end with 0: A005498;
positions in W of words w(n) that end with 1: A005843;
positions in W of words w(n) such that first digit = last digit: A346301;
positions in W of words w(n) such that first digit != last digit: A346302;
positions in W of words w(n) such that 1st digit = 0 and last digit 0: A171757;
positions in W of words w(n) such that 1st digit = 0 and last digit 1: A346303;
positions in W of words w(n) such that 1st digit = 1 and last digit 0: A346304;
positions in W of words w(n) such that 1st digit = 1 and last digit 1: A346305;
position in W of n-th positive integer (base 2): A206332;
positions in W of binary complement of w(n): A346306;
sum of digits in w(n): A048881;
number of runs in w(n): A346307;
positions in W of palindromes: A346308;
positions in W of words such that #0's - #1's is odd: A346309;
positions in W of words such that #0's - #1's is even: A346310;
positions in W of the reversal of the n-th word in W: A081241. (End)

Examples

			0,
1,
0,0,
0,1,
1,0,
1,1,
0,0,0,
0,0,1,
0,1,0,
0,1,1,
1,0,0,
1,0,1,
...
		

References

  • Bodil Branner, Dynamics, Chap. IV.14 of The Princeton Companion to Mathematics, ed. T. Gowers, p. 499.
  • K. Dajani and C. Kraaikamp, Ergodic Theory of Numbers, Math. Assoc. America, 2002, p. 72.

Crossrefs

Programs

  • Haskell
    import Data.List (unfoldr)
    a076478 n = a076478_list !! n
    a076478_list = concat $ tail $ map (tail . reverse . unfoldr
       (\x -> if x == 0 then Nothing else Just $ swap $ divMod x 2 )) [1..]
    -- Reinhard Zumkeller, Feb 08 2012
    
  • Haskell
    a076478_row n = a076478_tabf !! n :: [[Int]]
    a076478_tabf = tail $ iterate (\bs -> map (0 :) bs ++ map (1 :) bs) [[]]
    a076478_list' = concat $ concat a076478_tabf
    -- Reinhard Zumkeller, Aug 18 2015
    
  • Mathematica
    d[n_] := Rest@IntegerDigits[n + 1, 2] + 1; -1 + Flatten[Array[d, 50]] (* Clark Kimberling, Feb 07 2012 *)
    z = 1000;
    t1 = Table[Tuples[{0, 1}, n], {n, 1, 10}];
    "All binary words, lexicographic order:"
    tt = Flatten[t1, 1]; (* all binary words, lexicographic order *)
    "All binary words, flattened:"
    Flatten[tt];
    w[n_] := tt[[n]];
    "List tt of all binary words:"
    tt = Table[w[n], {n, 1, z}]; (*  all the binary words *)
    u1 = Flatten[tt]; (* words, concatenated, A076478, binary Champernowne sequence *)
    u2 = Map[Length, tt];
    "Positions of 0^n:"
    Flatten[Position[Map[Union, tt], {0}]]
    "Positions of 1^n:"
    Flatten[Position[Map[Union, tt], {1}]]
    "Positions of words in which #0's = #1's:"  (* A258410 *)
    "This and the next two sequences partition N."
    u3 = Select[Range[Length[tt]], Count[tt[[#]], 0] == Count[tt[[#]], 1] &]
    "Positions of words in which #0's < #1's:"  (* A346299 *)
    u4 = Select[Range[Length[tt]], Count[tt[[#]], 0] < Count[tt[[#]], 1] &]
    "Positions of words in which #0's > #1's:"  (* A346300 *)
    u5 = Select[Range[Length[tt]], Count[tt[[#]], 0] > Count[tt[[#]], 1] &]
    "Positions of words ending with 0:" (* A005498 *)
    u6 = Select[Range[Length[tt]], Last[tt[[#]]] == 0 &]
    "Positions of words ending with 1:" (* A005843 *)
    u7 = Select[Range[Length[tt]], Last[tt[[#]]] == 1 &]
    "Positions of words starting and ending with same digit:" (* A346301 *)
    u8 = Select[Range[Length[tt]], First[tt[[#]]] == Last[tt[[#]]] &]
    "Positions of words starting and ending with opposite digits:" (* A346302  *)
    u9 = Select[Range[Length[tt]], First[tt[[#]]] != Last[tt[[#]]] &]
    "Positions of words starting with 0 and ending with 0:" (* A346303 *)
    "This and the next three sequences partition N."
    u10 = Select[Range[Length[tt]], First[tt[[#]]] == 0 && Last[tt[[#]]] == 0 &]
    "Positions of words starting with 0 and ending with 1:" (* A171757 *)
    u11 = Select[Range[Length[tt]], First[tt[[#]]] == 0 && Last[tt[[#]]] == 1 &]
    "Positions of words starting with 1 and ending with 0:" (* A346304 *)
    u12 = Select[Range[Length[tt]], First[tt[[#]]] == 1 && Last[tt[[#]]] == 0 &]
    "Positions of words starting with 1 and ending with 1:" (* A346305 *)
    u13 = Select[Range[Length[tt]], First[tt[[#]]] == 1 && Last[tt[[#]]] == 1 &]
    "Position of n-th positive integer (base 2) in tt:"
    d[n_] := If[First[w[n]] == 1, FromDigits[w[n], 2]];
    u14 = Flatten[Table[Position[Table[d[n], {n, 1, 200}], n], {n, 1, 200}]] (* A206332 *)
    "Position of binary complement of w(n):"
    u15 = comp = Flatten[Table[Position[tt, 1 - w[n]], {n, 1, 50}]] (* A346306 *)
    "Sum of digits of w(n):"
    u16 = Table[Total[w[n]], {n, 1, 100}] (* A048881 *)
    "Number of runs in w(n):"
    u17 = Map[Length, Table[Map[Length, Split[w[n]]], {n, 1, 100}]] (* A346307 *)
    "Palindromes:"
    Select[tt, # == Reverse[#] &]
    "Positions of palindromes:"
    u18 = Select[Range[Length[tt]], tt[[#]] == Reverse[tt[[#]]] &] (* A346308 *)
    "Positions of words in which #0's - #1's is odd:"
    u19 = Select[Range[Length[tt]], OddQ[Count[w[#], 0] - Count[w[#], 1]] &] (* A346309 *)
    "Positions of words in which #0's - #1's is even:"
    u20 = Select[Range[Length[tt]], EvenQ[Count[w[#], 0] - Count[w[#], 1]] &] (* A346310 *)
    "Position of the reversal of the n-th word:"  (* A081241 *)
    u21 = Flatten[Table[Position[tt, Reverse[w[n]]], {n, 1, 150}]]
    (* Clark Kimberling, Jul 18 2011 *)
  • PARI
    {m=5; for(d=1,m, for(k=0,2^d-1,v=binary(k); while(matsize(v)[2]
    				
  • PARI
    listn(n)= my(a=List(), i=0, s=0); while(s<=n, listput(~a, binary(i++)[^1]); s+=#a[#a]); concat(a)[1..n+1]; \\ Ruud H.G. van Tol, Mar 17 2025
    
  • Python
    from itertools import count, product
    def agen():
        for digits in count(1):
            for b in product([0, 1], repeat=digits):
                yield from b
    g = agen()
    print([next(g) for n in range(105)]) # Michael S. Branicky, Jul 18 2021

Formula

To get the m-th binary vector, write m+1 in base 2 and remove the initial 1. - Clark Kimberling, Feb 07 2010

Extensions

Extended by Klaus Brockhaus, Nov 11 2002

A262586 Square array T(n,m) (n>=0, m>=0) read by antidiagonals downwards giving number of rooted triangulations of type [n,m] up to orientation-preserving isomorphisms.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 4, 5, 6, 5, 6, 16, 21, 26, 24, 19, 48, 88, 119, 147, 133, 49, 164, 330, 538, 735, 892, 846, 150, 559, 1302, 2310, 3568, 4830, 5876, 5661, 442, 1952, 5005, 9882, 16500, 24596, 33253, 40490, 39556, 1424, 6872, 19504, 41715, 75387, 120582, 176354, 237336, 290020, 286000, 4522
Offset: 0

Views

Author

N. J. A. Sloane, Oct 20 2015

Keywords

Examples

			Array begins:
 ==============================================================
 n\k |    0     1      2       3       4        5         6 ...
 ----+---------------------------------------------------------
   0 |    1     1      1       4       6       19        49 ...
   1 |    1     2      5      16      48      164       559 ...
   2 |    1     6     21      88     330     1302      5005 ...
   3 |    5    26    119     538    2310     9882     41715 ...
   4 |   24   147    735    3568   16500    75387    338685 ...
   5 |  133   892   4830   24596  120582   578622   2730728 ...
   6 |  846  5876  33253  176354  900240  4493168  22037055 ...
   7 | 5661 40490 237336 1298732 6849810 35286534 178606610 ...
   ...
The first few antidiagonals are:
  1,
  1,1,
  1,2,1,
  4,5,6,5,
  6,16,21,26,24,
  19,48,88,119,147,133,
  49,164,330,538,735,892,846,
  ...
		

Crossrefs

Columns 0..2 are A002709, A002710, A002711.
Rows 0..3 are A001683, A210696, A005498, A005499.
Antidiagonal sums are A341855.
Cf. A169808 (unoriented), A169809 (achiral).

Programs

  • Maple
    A262586 := proc(n,m)
        BrownG(n,m) ; # procedure in A210696
    end proc:
    for d from 0 to 12 do
        for n from 0 to d do
            printf("%d,",A262586(n,d-n)) ;
        end do:
    end do: # R. J. Mathar, Oct 21 2015
  • Mathematica
    (* See LINKS section. *)
  • PARI
    \\ See Links in A169808 for PARI program file.
    { for(n=0, 7, for(k=0, 7, print1(OrientedTriangs(n,k), ", ")); print) } \\ Andrew Howroyd, Nov 23 2024

Formula

Brown (Eq. 6.3) gives a formula.

A187469 Array: five joint rank sequences tending to lower Wythoff sequence A000201, by columns.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 5, 4, 4, 4, 4, 7, 6, 6, 6, 6, 9, 7, 8, 8, 8, 11, 9, 9, 9, 9, 13, 10, 11, 11, 11, 15, 12, 13, 12, 12, 17, 13, 14, 14, 14, 19, 15, 16, 16, 16, 21, 16, 18, 17, 17, 23, 18, 19, 19, 19, 25, 19, 21, 20, 21, 27, 21, 23, 22, 22, 29, 22, 24, 24, 24, 31, 24, 26, 25, 25
Offset: 1

Views

Author

Clark Kimberling, Mar 10 2011

Keywords

Comments

Precedents are discussed at A187224: adjusted joint rank sequence (AJRS) and the rank transform.
Row 1 (A005498, odds) is the AJRS of the natural number sequence N=A000027 with itself. Row 2 is the AJRS of N and row 1; row 3 is the AJRS of N and row 2; etc. The limit row is the rank transform of N, the lower Wythoff sequence, A000201. The array shows the first five AJRSs and indicates fairly rapid convergence.

Examples

			The array consists of five sequences:
1..3..5..7..9..11..13..15..17..19..21..23..25..27..29..31..
1..3..4..6..7..9...10..12..13..15..16..18..19..21..22..24..
1..3..4..6..8..9...11..13..14..16..18..19..21..23..24..26..
1..3..4..5..8..9...11..12..14..16..17..19..20..22..24..25..
1..3..4..6..8..9...11..12..14..16..17..19..21..22..24..25..
		

Crossrefs

Programs

  • Mathematica
    seqA = Table[n, {n, 1, 120}];
    seqB = seqA;
    jointRank[{seqA_, seqB_}] := {Flatten@Position[#1,
    {_, 1}],
    Flatten@Position[#1, {_, 2}]} & [Sort@Flatten[{{#1, 1} & /@ seqA, {#1, 2} & /@seqB}, 1]]; (#1[[1]] &) /@
    FixedPointList[jointRank[{seqA, #1[[1]]}] &, jointRank[{seqA, seqB}], 4];
    TableForm[%]
    (* by Peter J. C. Moses, Mar 10 2011 *)
Showing 1-3 of 3 results.