login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A007088 The binary numbers (or binary words, or binary vectors, or binary expansion of n): numbers written in base 2.
(Formerly M4679)
747

%I M4679 #160 Jan 23 2024 02:48:52

%S 0,1,10,11,100,101,110,111,1000,1001,1010,1011,1100,1101,1110,1111,

%T 10000,10001,10010,10011,10100,10101,10110,10111,11000,11001,11010,

%U 11011,11100,11101,11110,11111,100000,100001,100010,100011,100100,100101,100110,100111

%N The binary numbers (or binary words, or binary vectors, or binary expansion of n): numbers written in base 2.

%C List of binary numbers. (This comment is to assist people searching for that particular phrase. - _N. J. A. Sloane_, Apr 08 2016)

%C Or, numbers that are sums of distinct powers of 10.

%C Or, numbers having only digits 0 and 1 in their decimal representation.

%C Complement of A136399; A064770(a(n)) = a(n). - _Reinhard Zumkeller_, Dec 30 2007

%C From _Rick L. Shepherd_, Jun 25 2009: (Start)

%C Nonnegative integers with no decimal digit > 1.

%C Thus nonnegative integers n in base 10 such that kn can be calculated by normal addition (i.e., n + n + ... + n, with k n's (but not necessarily k + k + ... + k, with n k's)) or multiplication without requiring any carry operations for 0 <= k <= 9. (End)

%C For n > 1: A257773(a(n)) = 10, numbers that are Belgian-k for k=0..9. - _Reinhard Zumkeller_, May 08 2015

%C For any integer n>=0, find the binary representation and then interpret as decimal representation giving a(n). - _Michael Somos_, Nov 15 2015

%C N is in this sequence iff A007953(N) = A101337(N). A028897 is a left inverse. - _M. F. Hasler_, Nov 18 2019

%C For n > 0, numbers whose largest decimal digit is 1. - _Stefano Spezia_, Nov 15 2023

%D Heinz Gumin, "Herrn von Leibniz' 'Rechnung mit Null und Eins'", Siemens AG, 3. Auflage 1979 -- contains facsimiles of Leibniz's papers from 1679 and 1703.

%D Manfred R. Schroeder, "Fractals, Chaos, Power Laws", W. H. Freeman, 1991, p. 383.

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

%H N. J. A. Sloane, <a href="/A007088/b007088.txt">Table of n, a(n) for n = 0..32768</a> (first 8192 terms from Franklin T. Adams-Watters)

%H Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, <a href="https://arxiv.org/abs/2210.10968">Identities and periodic oscillations of divide-and-conquer recurrences splitting at half</a>, arXiv:2210.10968 [cs.DS], 2022, p. 45.

%H G. W. Leibniz, <a href="https://hal.archives-ouvertes.fr/ads-00104781">Explication de l'arithmétique binaire, qui se sert des seuls caractères 0 & 1; avec des remarques sur son utilité, et sur ce qu'elle donne le sens des anciennes figures chinoises de Fohy</a>, Mémoires de l'Académie Royale des Sciences, 1703, pp. 85-89; reprinted in Gumin (1979).

%H N. J. A. Sloane, <a href="/A007088/a007088.txt">Table of a(n) for n = 0..1048576</a> (A large file)

%H R. G. Wilson, V, <a href="/A007088/a007088.pdf">Letter to N. J. A. Sloane, Sep. 1992</a>

%H <a href="/index/Mo#MWP">Index entries for sequences related to Most Wanted Primes video</a>

%H <a href="/index/Ar#10-automatic">Index entries for 10-automatic sequences</a>.

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%F a(n) = Sum_{i=0..m} d(i)*10^i, where Sum_{i=0..m} d(i)*2^i is the base 2 representation of n.

%F a(n) = (1/2)*Sum_{i>=0} (1-(-1)^floor(n/2^i))*10^i. - _Benoit Cloitre_, Nov 20 2001

%F a(n) = A097256(n)/9.

%F a(2n) = 10*a(n), a(2n+1) = a(2n)+1.

%F G.f.: 1/(1-x) * Sum_{k>=0} 10^k * x^(2^k)/(1+x^(2^k)) - for sequence as decimal integers. - _Franklin T. Adams-Watters_, Jun 16 2006

%F a(A000290(n)) = A001737(n). - _Reinhard Zumkeller_, Apr 25 2009

%F a(n) = Sum_{k>=0} A030308(n,k)*10^k. - _Philippe Deléham_, Oct 19 2011

%F For n > 0: A054055(a(n)) = 1. - _Reinhard Zumkeller_, Apr 25 2012

%F a(n) = Sum_{k=0..floor(log_2(n))} floor((Mod(n/2^k, 2)))*(10^k). - _José de Jesús Camacho Medina_, Jul 24 2014

%e a(6)=110 because (1/2)*((1-(-1)^6)*10^0 + (1-(-1)^3)*10^1 + (1-(-1)^1)*10^2) = 10 + 100.

%e G.f. = x + 10*x^2 + 11*x^3 + 100*x^4 + 101*x^5 + 110*x^6 + 111*x^7 + 1000*x^8 + ...

%e .

%e 000 The numbers < 2^n can be regarded as vectors with

%e 001 a fixed length n if padded with zeros on the left

%e 010 side. This represents the n-fold Cartesian product

%e 011 over the set {0, 1}. In the example on the left,

%e 100 n = 3. (See also the second Python program.)

%e 101 Binary vectors in this format can also be seen as a

%e 110 representation of the subsets of a set with n elements.

%e 111 - _Peter Luschny_, Jan 22 2024

%p A007088 := n-> convert(n, binary): seq(A007088(n), n=0..50); # _R. J. Mathar_, Aug 11 2009

%t Table[ FromDigits[ IntegerDigits[n, 2]], {n, 0, 39}]

%t Table[Sum[ (Floor[( Mod[f/2 ^n, 2])])*(10^n) , {n, 0, Floor[Log[2, f]]}], {f, 1, 100}] (* _José de Jesús Camacho Medina_, Jul 24 2014 *)

%t FromDigits/@Tuples[{1,0},6]//Sort (* _Harvey P. Dale_, Aug 10 2017 *)

%o (PARI) {a(n) = subst( Pol( binary(n)), x, 10)}; /* _Michael Somos_, Jun 07 2002 */

%o (PARI) {a(n) = if( n<=0, 0, n%2 + 10*a(n\2))}; /* _Michael Somos_, Jun 07 2002 */

%o (PARI) a(n)=fromdigits(binary(n),10) \\ _Charles R Greathouse IV_, Apr 08 2015

%o (Haskell)

%o a007088 0 = 0

%o a007088 n = 10 * a007088 n' + m where (n',m) = divMod n 2

%o -- _Reinhard Zumkeller_, Jan 10 2012

%o (Python)

%o def a(n): return int(bin(n)[2:])

%o print([a(n) for n in range(40)]) # _Michael S. Branicky_, Jan 10 2021

%o (Python)

%o from itertools import product

%o n = 4

%o for p in product([0, 1], repeat=n): print(''.join(str(x) for x in p))

%o # _Peter Luschny_, Jan 22 2024

%Y The basic sequences concerning the binary expansion of n are this one, A000120 (Hammingweight: sum of bits), A000788 (partial sums of A000120), A000069 (A000120 is odd), A001969 (A000120 is even), A023416 (number of bits 0), A059015 (partial sums). Bisections A099820 and A099821.

%Y Cf. A028897 (convert binary to decimal).

%Y Cf. A000042, A007089-A007095, A000695, A005836, A033042-A033052, A159918, A004290, A169965, A169966, A169967, A169964, A204093, A204094, A204095, A097256, A257773, A257770.

%Y Cf. A000290, A001737, A007953, A030308, A054055, A064770, A101337, A136399.

%K nonn,base,nice,easy

%O 0,3

%A _N. J. A. Sloane_, _Robert G. Wilson v_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 21:09 EDT 2024. Contains 371798 sequences. (Running on oeis4.)