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

A066099 Triangle read by rows, in which row n lists the compositions of n in reverse lexicographic order.

Original entry on oeis.org

1, 2, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 4, 3, 1, 2, 2, 2, 1, 1, 1, 3, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 5, 4, 1, 3, 2, 3, 1, 1, 2, 3, 2, 2, 1, 2, 1, 2, 2, 1, 1, 1, 1, 4, 1, 3, 1, 1, 2, 2, 1, 2, 1, 1, 1, 1, 3, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 6, 5, 1, 4, 2, 4, 1, 1, 3, 3, 3, 2, 1, 3, 1, 2, 3, 1, 1, 1, 2, 4, 2, 3
Offset: 1

Views

Author

Alford Arnold, Dec 30 2001

Keywords

Comments

The representation of the compositions (for fixed n) is as lists of parts, the order between individual compositions (for the same n) is (list-)reversed lexicographic; see the example by Omar E. Pol. - Joerg Arndt, Sep 03 2013
This is the standard ordering for compositions in this database; it is similar to the Mathematica ordering for partitions (A080577). Other composition orderings include A124734 (similar to the Abramowitz & Stegun ordering for partitions, A036036), A108244 (similar to the Maple partition ordering, A080576), etc (see crossrefs).
Factorize each term in A057335; sequence records the values of the resulting exponents. It also runs through all possible permutations of multiset digits.
This can be regarded as a table in two ways: with each composition as a row, or with the compositions of each integer as a row. The first way has A000120 as row lengths and A070939 as row sums; the second has A001792 as row lengths and A001788 as row sums. - Franklin T. Adams-Watters, Nov 06 2006
This sequence includes every finite sequence of positive integers. - Franklin T. Adams-Watters, Nov 06 2006
Compositions (or ordered partitions) are also generated in sequence A101211. - Alford Arnold, Dec 12 2006
The equivalent sequence for partitions is A228531. - Omar E. Pol, Sep 03 2013
The sole partition of zero has no components, not a single component of length one. Hence the first nonempty row is row 1. - Franklin T. Adams-Watters, Apr 02 2014 [Edited by Andrey Zabolotskiy, May 19 2018]
See sequence A261300 for another version where the terms of each composition are concatenated to form one single integer: (0, 1, 2, 11, 3, 21, 12, 111,...). This also shows how the terms can be obtained from the binary numbers A007088, cf. Arnold's first Example. - M. F. Hasler, Aug 29 2015
The k-th composition in the list is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This is described as the standard ordering used in the OEIS, although the sister sequence A228351 is also sometimes considered to be canonical. Both sequences define a bijective correspondence between nonnegative integers and integer compositions. - Gus Wiseman, May 19 2020
First differences of A030303 = positions of bits 1 in the concatenation A030190 (= A030302) of numbers written in binary (A007088). - Indices of record values (= first occurrence of n) are given by A005183: a(A005183(n)) = n, cf. FORMULA for more. - M. F. Hasler, Oct 12 2020
The geometric mean approaches the Somos constant (A112302). - Jwalin Bhatt, Feb 10 2025

Examples

			A057335 begins 1 2 4 6 8 12 18 30 16 24 36 ... so we can write
  1 2 1 3 2 1 1 4 3 2 2 1 1 1 1 ...
  . . 1 . 1 2 1 . 1 2 1 3 2 1 1 ...
  . . . . . . 1 . . . 1 . 1 2 1 ...
  . . . . . . . . . . . . . . 1 ...
and the columns here gives the rows of the triangle, which begins
  1
  2; 1 1
  3; 2 1; 1 2; 1 1 1
  4; 3 1; 2 2; 2 1 1; 1 3; 1 2 1; 1 1 2; 1 1 1 1
  ...
From _Omar E. Pol_, Sep 03 2013: (Start)
Illustration of initial terms:
  -----------------------------------
  n  j       Diagram   Composition j
  -----------------------------------
  .               _
  1  1           |_|   1;
  .             _ _
  2  1         |  _|   2,
  2  2         |_|_|   1, 1;
  .           _ _ _
  3  1       |    _|   3,
  3  2       |  _|_|   2, 1,
  3  3       | |  _|   1, 2,
  3  4       |_|_|_|   1, 1, 1;
  .         _ _ _ _
  4  1     |      _|   4,
  4  2     |    _|_|   3, 1,
  4  3     |   |  _|   2, 2,
  4  4     |  _|_|_|   2, 1, 1,
  4  5     | |    _|   1, 3,
  4  6     | |  _|_|   1, 2, 1,
  4  7     | | |  _|   1, 1, 2,
  4  8     |_|_|_|_|   1, 1, 1, 1;
(End)
		

Crossrefs

Lists of compositions of integers: this sequence (reverse lexicographic order; minus one gives A108730), A228351 (reverse colexicographic order - every composition is reversed; minus one gives A163510), A228369 (lexicographic), A228525 (colexicographic), A124734 (length, then lexicographic; minus one gives A124735), A296774 (length, then reverse lexicographic), A337243 (length, then colexicographic), A337259 (length, then reverse colexicographic), A296773 (decreasing length, then lexicographic), A296772 (decreasing length, then reverse lexicographic), A337260 (decreasing length, then colexicographic), A108244 (decreasing length, then reverse colexicographic), also A101211 and A227736 (run lengths of bits).
Cf. row length and row sums for different splittings into rows: A000120, A070939, A001792, A001788.
Cf. lists of partitions of integers, or multisets of integers: A026791 and crosserfs therein, A112798 and crossrefs therein.
See link for additional crossrefs pertaining to standard compositions.
A related ranking of finite sets is A048793/A272020.

Programs

  • Haskell
    a066099 = (!!) a066099_list
    a066099_list = concat a066099_tabf
    a066099_tabf = map a066099_row [1..]
    a066099_row n = reverse $ a228351_row n
    -- (each composition as a row)
    -- Peter Kagey, Aug 25 2016
    
  • Mathematica
    Table[FactorInteger[Apply[Times, Map[Prime, Accumulate @ IntegerDigits[n, 2]]]][[All, -1]], {n, 41}] // Flatten (* Michael De Vlieger, Jul 11 2017 *)
    stc[n_] := Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]] // Reverse;
    Table[stc[n], {n, 0, 20}] // Flatten (* Gus Wiseman, May 19 2020 *)
    Table[Reverse @ LexicographicSort @ Flatten[Permutations /@ Partitions[n], 1], {n, 10}] // Flatten (* Eric W. Weisstein, Jun 26 2023 *)
  • PARI
    arow(n) = {local(v=vector(n),j=0,k=0);
       while(n>0,k++; if(n%2==1,v[j++]=k;k=0);n\=2);
       vector(j,i,v[j-i+1])} \\ returns empty for n=0. - Franklin T. Adams-Watters, Apr 02 2014
    
  • Python
    from itertools import islice
    from itertools import accumulate, count, groupby, islice
    def A066099_gen():
        for i in count(1):
            yield [len(list(g)) for _,g in groupby(accumulate(int(b) for b in bin(i)[2:]))]
    A066099 = list(islice(A066099_gen(), 120))  # Jwalin Bhatt, Feb 28 2025
  • Sage
    def a_row(n): return list(reversed(Compositions(n)))
    flatten([a_row(n) for n in range(1,6)]) # Peter Luschny, May 19 2018
    

Formula

From M. F. Hasler, Oct 12 2020: (Start)
a(n) = A030303(n+1) - A030303(n).
a(A005183(n)) = n; a(A005183(n)+1) = n-1 (n>1); a(A005183(n)+2) = 1. (End)

Extensions

Edited with additional terms by Franklin T. Adams-Watters, Nov 06 2006
0th row removed by Andrey Zabolotskiy, May 19 2018

A030190 Binary Champernowne sequence (or word): write the numbers 0,1,2,3,4,... in base 2 and juxtapose.

Original entry on oeis.org

0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 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, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0
Offset: 0

Views

Author

Keywords

Comments

a(A003607(n)) = 0 and for n > 0: a(A030303(n)) = 1. - Reinhard Zumkeller, Dec 11 2011
An irregular table in which the n-th row lists the bits of n (see the example section). - Jason Kimberley, Dec 07 2012
The binary Champernowne constant: it is normal in base 2. - Jason Kimberley, Dec 07 2012
This is the characteristic function of A030303, which gives the indices of 1's in this sequence and has first differences given by A066099. - M. F. Hasler, Oct 12 2020

Examples

			As an array, this begins:
0,
1,
1, 0,
1, 1,
1, 0, 0,
1, 0, 1,
1, 1, 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,
1, 0, 0, 0, 0,
1, 0, 0, 0, 1,
...
		

References

  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.

Crossrefs

Cf. A007376, A003137, A030308. Same as and more fundamental than A030302, but I have left A030302 in the OEIS because there are several sequences that are based on it (A030303 etc.). - N. J. A. Sloane.
a(n) = T(A030530(n), A083652(A030530(n))-n-1), T as defined in A083651, a(A083652(k))=1.
Tables in which the n-th row lists the base b digits of n: this sequence and A030302 (b=2), A003137 and A054635 (b=3), A030373 (b=4), A031219 (b=5), A030548 (b=6), A030998 (b=7), A031035 and A054634 (b=8), A031076 (b=9), A007376 and A033307 (b=10). - Jason Kimberley, Dec 06 2012
A076478 is a similar sequence.
For run lengths see A056062; see also A318924.
See also A066099 for (run lengths of 0s) + 1 = first difference of positions of 1s given by A030303.

Programs

  • Haskell
    import Data.List (unfoldr)
    a030190 n = a030190_list !! n
    a030190_list = concatMap reverse a030308_tabf
    -- Reinhard Zumkeller, Jun 16 2012, Dec 11 2011
    
  • Magma
    [0]cat &cat[Reverse(IntegerToSequence(n,2)):n in[1..31]]; // Jason Kimberley, Dec 07 2012
    
  • Mathematica
    Flatten[ Table[ IntegerDigits[n, 2], {n, 0, 26}]] (* Robert G. Wilson v, Mar 08 2005 *)
    First[RealDigits[ChampernowneNumber[2], 2, 100, 0]] (* Paolo Xausa, Jun 16 2024 *)
  • PARI
    A030190_row(n)=if(n,binary(n),[0]) \\ M. F. Hasler, Oct 12 2020
    
  • Python
    from itertools import count, islice
    def A030190_gen(): return (int(d) for m in count(0) for d in bin(m)[2:])
    A030190_list = list(islice(A030190_gen(),30)) # Chai Wah Wu, Jan 07 2022

A030302 Write n in base 2 and juxtapose; irregular table in which row n lists the binary expansion of n.

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 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, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1
Offset: 1

Views

Author

Keywords

Comments

The binary Champernowne constant: it is normal in base 2. - Jason Kimberley, Dec 07 2012
A word that is recurrent, but neither morphic nor uniformly recurrent. - N. J. A. Sloane, Jul 14 2018
See A030303 for the indices of 1's (so this is the characteristic function of A030303), with first differences (i.e., run lengths of 0's, increased by 1, with two consecutive 1's delimiting a run of zero 0's) given by A066099. - M. F. Hasler, Oct 12 2020

References

  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.

Crossrefs

Essentially the same as A007088 and A030190. Cf. A030303, A007088.
Tables in which the n-th row lists the base b digits of n: A030190 and this sequence (b=2), A003137 and A054635 (b=3), A030373 (b=4), A031219 (b=5), A030548 (b=6), A030998 (b=7), A031035 and A054634 (b=8), A031076 (b=9), A007376 and A033307 (b=10). [Jason Kimberley, Dec 06 2012]
Sequences mentioned in the Allouche et al. "Taxonomy" paper, listed by example number: 1: A003849, 2: A010060, 3: A010056, 4: A020985 and A020987, 5: A191818, 6: A316340 and A273129, 18: A316341, 19: A030302, 20: A063438, 21: A316342, 22: A316343, 23: A003849 minus its first term, 24: A316344, 25: A316345 and A316824, 26: A020985 and A020987, 27: A316825, 28: A159689, 29: A049320, 30: A003849, 31: A316826, 32: A316827, 33: A316828, 34: A316344, 35: A043529, 36: A316829, 37: A010060.

Programs

  • Magma
    &cat[Reverse(IntegerToSequence(n,2)): n in [1..31]]; // Jason Kimberley, Mar 02 2012
    
  • Maple
    A030302 := proc(n) local i,t1,t2; t1:=convert(n,base,2); t2:=nops(t1); [seq(t1[t2+1-i],i=1..t2)]; end; # N. J. A. Sloane, Apr 08 2021
  • Mathematica
    i[n_] := Ceiling[FullSimplify[ProductLog[Log[2]/2 (n - 1)]/Log[2] + 1]]; a[n_] := Mod[Floor[2^(Mod[n + 2^i[n] - 2, i[n]] - i[n] + 1) Ceiling[(n + 2^i[n] - 1)/i[n] - 1]], 2]; (* David W. Cantrell (DWCantrell(AT)sigmaxi.net), Feb 19 2007 *)
    Join @@ Table[ IntegerDigits[i, 2], {i, 1, 40}] (* Olivier Gérard, Mar 28 2011 *)
    Flatten@ IntegerDigits[ Range@ 25, 2] (* or *)
    almostNatural[n_, b_] := Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = (b - 1) i*b^(i - 1) + l; i++]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + b^(i - 1); If[p != 0, IntegerDigits[q, b][[p]], Mod[q - 1, b]]]; Array[ almostNatural[#, 2] &, 105] (* Robert G. Wilson v, Jun 29 2014 *)
  • Python
    from itertools import count, islice
    def A030302_gen(): # generator of terms
        return (int(d) for n in count(1) for d in bin(n)[2:])
    A030302_list = list(islice(A030302_gen(),30)) # Chai Wah Wu, Feb 18 2022

Formula

a(n) = (floor(2^(((n + 2^i - 2) mod i) - i + 1) * ceiling((n + 2^i - 1)/i - 1))) mod 2 where i = ceiling( W(log(2)/2 (n - 1))/log(2) + 1 ) and W denotes the principal branch of the Lambert W function. See also Mathematica code. - David W. Cantrell (DWCantrell(AT)sigmaxi.net), Feb 19 2007

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

Original entry on oeis.org

1, 2, 5, 13, 33, 81, 193, 449, 1025, 2305, 5121, 11265, 24577, 53249, 114689, 245761, 524289, 1114113, 2359297, 4980737, 10485761, 22020097, 46137345, 96468993, 201326593, 419430401, 872415233, 1811939329, 3758096385, 7784628225, 16106127361, 33285996545
Offset: 0

Views

Author

Keywords

Comments

a(n-1) is the number of permutations of length n which avoid the patterns 132, 4312. - Lara Pudwell, Jan 21 2006
Number of sequences (e(1), ..., e(n+1)), 0 <= e(i) < i, such that there is no triple i < j < k with e(i) <= e(j) >= e(k) and e(i) != e(k). [Martinez and Savage, 2.11] - Eric M. Schmidt, Jul 17 2017
Indices of records in A066099. Also, indices of "cusps" in the graph of A030303 giving positions of 1's in the binary Champernowne word A030190. - M. F. Hasler, Oct 12 2020

References

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

Crossrefs

Programs

Formula

Main diagonal of the array defined by T(0, j)=j+1 j>=0, T(i, 0)=i+1 i>=0, T(i, j)=T(i-1, j-1)+T(i-1, j)-1. - Benoit Cloitre, Jun 17 2003
G.f.: (1 -3*x +3*x^2)/((1-x)*(1-2*x)^2). - Lara Pudwell, Jan 21 2006
E.g.f.: exp(x) +x*exp(2*x). - Joerg Arndt, May 22 2013
Binomial transform of A028310. a(n) = 1 + Sum{k=0..n} C(n, k)*k = 1 + A001787(n). - Paul Barry, Jul 21 2003
a(n) = Sum_{k=0..2^n} A000120(k) = A000788(2^n). - Benoit Cloitre, Sep 25 2003
Row sums of triangle A134399. - Gary W. Adamson, Oct 23 2007
a(n) = A000788(A000079(n)). - Reinhard Zumkeller, Mar 04 2010
a(n) = 2*a(n-1) +2^(n-1) -1 (with a(0)=1). - Vincenzo Librandi, Dec 31 2010

Extensions

More terms from Lara Pudwell, Jan 21 2006
Edited by N. J. A. Sloane at the suggestion of Jim Propp, Jul 14 2007

A242628 Irregular table enumerating partitions; n-th row has partitions in previous row with each part incremented, followed by partitions in previous row with an additional part of size 1.

Original entry on oeis.org

1, 2, 1, 1, 3, 2, 2, 2, 1, 1, 1, 1, 4, 3, 3, 3, 2, 2, 2, 2, 3, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 5, 4, 4, 4, 3, 3, 3, 3, 4, 2, 3, 3, 2, 3, 2, 2, 2, 2, 2, 2, 4, 1, 3, 3, 1, 3, 2, 1, 2, 2, 2, 1, 3, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 6, 5, 5, 5, 4, 4, 4, 4, 5, 3, 4, 4, 3, 4, 3, 3, 3, 3, 3, 3, 5, 2
Offset: 1

Views

Author

Keywords

Comments

This can be calculated using the binary expansion of n; see the PARI program.
The n-th row consists of all partitions with hook size (maximum + number of parts - 1) equal to n.
The partitions in row n of this sequence are the conjugates of the partitions in row n of A125106 taken in reverse order.
Row n is also the reversed partial sums plus one of the n-th composition in standard order (A066099) minus one. - Gus Wiseman, Nov 07 2022

Examples

			The table starts:
  1;
  2; 1,1;
  3; 2,2; 2,1; 1,1,1;
  4; 3,3; 3,2; 2,2,2; 3,1 2,2,1 2,1,1 1,1,1,1;
  ...
		

Crossrefs

Cf. A241596 (another version of this list of partitions), A125106, A240837, A112531, A241597 (compositions).
For other schemes to list integer partitions, please see for example A227739, A112798, A241918, A114994.
First element in each row is A008687.
Last element in each row is A065120.
Heinz numbers of rows are A253565.
Another version is A358134.

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=1, [[1]],
          [map(x-> map(y-> y+1, x), b(n-1))[],
           map(x-> [x[], 1], b(n-1))[]])
        end:
    T:= n-> map(x-> x[], b(n))[]:
    seq(T(n), n=1..7);  # Alois P. Heinz, Sep 25 2015
  • Mathematica
    T[1] = {{1}};
    T[n_] := T[n] = Join[T[n-1]+1, Append[#, 1]& /@ T[n-1]];
    Array[T, 7] // Flatten (* Jean-François Alcover, Jan 25 2021 *)
  • PARI
    apart(n) = local(r=[1]); while(n>1,if(n%2==0,for(k=1,#r,r[k]++),r=concat(r,[1]));n\=2);r \\ Generates n-th partition.

A066716 Decimal expansion of the binary Champernowne constant 0.862240125868... whose binary expansion is the concatenation of 1, 2, 3, ... written in binary.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Jan 14 2002

Keywords

Comments

A theorem of Copeland & Erdős proves that this constant is 2-normal. - Charles R Greathouse IV, Feb 06 2015
This constant is transcendental. Note that this result is nontrivial: it is not a corollary of the result of Masaaki Amou saying that the base-b Champernowne constant has irrationality measure b, because the Thue-Siegel-Roth theorem only guarantees that a number with irrationality measure greater than 2 is transcendental. However, it is already stated in Masaaki Amou's paper that K. Mahler proved that the base-b Champernowne constant is transcendental for all b. - Jianing Song, Sep 27 2023

Examples

			0.8622401258680545715577902832493945785657647427682990945160712145573067405905...
		

Crossrefs

Cf. A030302 (binary digits), A030190 (same with initial 0), A030303 (indices of 1's), A007088, A047778 (concatenate binary 1..n).
Cf. A066717 (continued fraction), A365238 (reciprocal).
Cf. A100125 (Sum n/2^(n^2)).
Cf. A033307.

Programs

  • Mathematica
    a = {}; Do[a = Append[a, IntegerDigits[n, 2]], {n, 1, 100} ]; RealDigits[ N[ FromDigits[ {Flatten[a], 0}, 2], 100]]
    First[RealDigits[ChampernowneNumber[2], 10, 100]] (* Paolo Xausa, Jun 12 2024 *)
  • PARI
    my(s=0.); forstep(n=default(realprecision),1,-1,s=(s+n)>>#binary(n)); s \\ Charles R Greathouse IV, Feb 06 2015, corrected by M. F. Hasler, Mar 22 2017
    
  • PARI
    s=0;sum(n=1,31,n*.5^s+=logint(n,2)+1) \\ Accurate to 0.5^s. The sum up to n=31 is enough for standard precision of 38 digits. - M. F. Hasler, Mar 22 2017

Formula

The "binary" Champernowne constant is the number whose base-2 expansion is the concatenation of the binary representations of the integers, 0.(1)(10)(11)(100)(101)(110)(111)(1000)..., cf. A030302.

Extensions

Leading zero removed, offset adjusted, and keyword:cons added by R. J. Mathar, Mar 04 2010
Name edited by M. F. Hasler, Oct 26 2019

A058935 Concatenation of first n binary numbers.

Original entry on oeis.org

0, 1, 110, 11011, 11011100, 11011100101, 11011100101110, 11011100101110111, 110111001011101111000, 1101110010111011110001001, 11011100101110111100010011010, 110111001011101111000100110101011, 1101110010111011110001001101010111100
Offset: 0

Views

Author

Henry Bottomley, Jan 12 2001

Keywords

Comments

If the terms are read as decimal numbers, which of them are primes? For example, a(5) = 11011100101 = 1193*9229757 is not a prime. - N. J. A. Sloane, Feb 17 2023
Answer: a(231) is the first prime term when read as a decimal number; a(15) is the first when read as a binary number. - Michael S. Branicky, Feb 17 2023

Crossrefs

Cf. A047778 for this converted to decimal, A001855 (offset) for number of digits.
Cf. A066716: binary Champernowne constant, A030302: binary digits, A030190: same with initial 0, A030303: indices of 1's, A007088.
Other bases: A117640 (4), A007908 (10).

Programs

  • Mathematica
    FromDigits /@ Flatten /@ Rest[FoldList[Append, {}, IntegerDigits[Range[10], 2]]] (* Eric W. Weisstein, Nov 04 2015 *)
  • Python
    from itertools import count, islice
    def agen(s=""): yield from (int(s:=s+bin(n)[2:]) for n in count(0))
    print(list(islice(agen(), 13))) # Michael S. Branicky, Feb 17 2023
    
  • Python
    from functools import reduce
    def A058935(n): return int(bin(reduce(lambda i,j:(i<Chai Wah Wu, Feb 26 2023

Formula

a(n) = a(n-1)*10^A029837(n) + A007088(n).

A351753 Take the first n digits on the binary Champernowne string (cf. A030302); a(n) gives the starting index of the second occurrence of this n-digit string within the binary Champernowne string.

Original entry on oeis.org

2, 4, 5, 12, 12, 12, 213, 517, 517, 517, 517, 517, 517, 517, 517, 517, 14457, 189569, 258049, 258049, 14144865, 14144865, 14144865, 131391133, 131391133, 199844657, 199844657, 199844657, 1196986333, 1196986333, 5176897753, 5176897753, 5176897753, 5176897753
Offset: 1

Views

Author

Scott R. Shannon, Feb 18 2022

Keywords

Comments

The twenty-first n-digit string is '110111001011101111000' (1808238 decimal) which cannot be readily split into consecutive smaller values implying it is likely its next occurrence is in its natural position, i.e., a(21) = 35876058.

Examples

			The binary Champernowne string starts 110111001011101111000100110101011....
a(1) = 2 as the second occurrence of '1' within the string starts at index 2.
a(2) = 4 as the second occurrence of '11' within the string starts at index 4.
a(3) = 5 as the second occurrence of '110' within the string starts at index 5.
a(4) = 12 as the second occurrence of '1101' within the string starts at index 12.
		

Crossrefs

Programs

  • Python
    from itertools import count
    def A351753(n):
        s1, s2 = tuple(), tuple()
        for i, s in enumerate(int(d) for n in count(1) for d in bin(n)[2:]):
            if i < n:
                s1 += (s,)
                s2 += (s,)
            else:
                s2 = s2[1:]+(s,)
                if s1 == s2:
                    return i-n+2 # Chai Wah Wu, Feb 18 2022
    (C++) // See Links section.

Extensions

a(18)-a(20) corrected and a(21)-a(34) added by Chai Wah Wu, Feb 18 2022

A003607 Location of 0's when natural numbers are listed in binary.

Original entry on oeis.org

0, 3, 7, 8, 10, 14, 19, 20, 21, 23, 24, 27, 29, 31, 36, 37, 40, 45, 51, 52, 53, 54, 56, 57, 58, 61, 62, 64, 66, 67, 71, 73, 74, 76, 78, 81, 84, 86, 92, 93, 94, 97, 98, 102, 104, 107, 113, 114, 118, 124, 131, 132, 133, 134, 135, 137, 138, 139, 140, 143, 144
Offset: 0

Views

Author

Keywords

References

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

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a003607 n = a003607_list !! n
    a003607_list = elemIndices 0 a030190_list
    -- Reinhard Zumkeller, Dec 11 2011
    
  • Mathematica
    Position[IntegerDigits[Range[0, 100], 2] // Flatten, 0] - 1 // Flatten (* Jean-François Alcover, Oct 06 2016 *)
  • Python
    from itertools import count, islice
    def A003607_gen(): # generator of terms
        return (i for i, s in enumerate(d for n in count(0) for d in bin(n)[2:]) if s == '0')
    A003607_list = list(islice(A003607_gen(),30)) # Chai Wah Wu, Feb 18 2022

Formula

A030190(a(n)) = 0. [Reinhard Zumkeller, Dec 11 2011]

A359114 a(1) = 1; for n > 1, a(n) is the smallest positive number which has not appeared that shares a factor with the sum of the first n bits of the binary Champernowne string starting from 1.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 10, 15, 8, 9, 7, 12, 18, 21, 14, 11, 16, 13, 26, 39, 52, 20, 22, 24, 25, 28, 30, 17, 34, 27, 32, 19, 35, 33, 36, 38, 40, 23, 42, 44, 45, 46, 48, 49, 50, 29, 51, 31, 54, 55, 57, 60, 63, 66, 56, 58, 62, 64, 65, 68, 69, 70, 37, 74, 72, 76, 78, 75, 80, 41, 82, 77, 81, 84, 43, 86
Offset: 1

Views

Author

Scott R. Shannon, Dec 16 2022

Keywords

Comments

For the binary Champernowne string starting from 1 see A030302. In the first 100000 terms the fixed points are 1, 2, 12, 24, 25; it is likely no more exist. The sequence is conjectured to be a permutation of the positive integers.

Examples

			a(3) = 4 as the sum of the first 3 bits of the binary Champernowne string is 1 + 1 + 0 = 2, and 4 is the smallest unused number that shares a factor with 2.
a(10) = 9 as the sum of the first 10 bits of the binary Champernowne string is 1 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 = 6, and 9 is the smallest unused number that shares a factor with 6.
		

Crossrefs

Cf. A030302, A030303, A359663 (base-10), A027749.
Showing 1-10 of 10 results.