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!)
A062880 Zero together with the numbers which can be written as a sum of distinct odd powers of 2. 31

%I #64 Aug 22 2023 08:01:58

%S 0,2,8,10,32,34,40,42,128,130,136,138,160,162,168,170,512,514,520,522,

%T 544,546,552,554,640,642,648,650,672,674,680,682,2048,2050,2056,2058,

%U 2080,2082,2088,2090,2176,2178,2184,2186,2208,2210,2216,2218,2560,2562

%N Zero together with the numbers which can be written as a sum of distinct odd powers of 2.

%C Binary expansion of n does not contain 1-bits at even positions.

%C Integers whose base-4 representation consists of only 0's and 2's.

%C Every nonnegative even number is a unique sum of the form a(k)+2*a(l); moreover, this sequence is unique with such property. - _Vladimir Shevelev_, Nov 07 2008

%C Also numbers such that the digital sum base 2 and the digital sum base 4 are in a ratio of 2:4. - _Michel Marcus_, Sep 23 2013

%C From _Gus Wiseman_, Jun 10 2020: (Start)

%C Numbers k such that the k-th composition in standard order has all even parts. The k-th composition in standard order (graded reverse-lexicographic, A066099) 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. For example, the sequence of all compositions into even parts begins:

%C 0: () 520: (6,4) 2080: (6,6)

%C 2: (2) 522: (6,2,2) 2082: (6,4,2)

%C 8: (4) 544: (4,6) 2088: (6,2,4)

%C 10: (2,2) 546: (4,4,2) 2090: (6,2,2,2)

%C 32: (6) 552: (4,2,4) 2176: (4,8)

%C 34: (4,2) 554: (4,2,2,2) 2178: (4,6,2)

%C 40: (2,4) 640: (2,8) 2184: (4,4,4)

%C 42: (2,2,2) 642: (2,6,2) 2186: (4,4,2,2)

%C 128: (8) 648: (2,4,4) 2208: (4,2,6)

%C 130: (6,2) 650: (2,4,2,2) 2210: (4,2,4,2)

%C 136: (4,4) 672: (2,2,6) 2216: (4,2,2,4)

%C 138: (4,2,2) 674: (2,2,4,2) 2218: (4,2,2,2,2)

%C 160: (2,6) 680: (2,2,2,4) 2560: (2,10)

%C 162: (2,4,2) 682: (2,2,2,2,2) 2562: (2,8,2)

%C 168: (2,2,4) 2048: (12) 2568: (2,6,4)

%C 170: (2,2,2,2) 2050: (10,2) 2570: (2,6,2,2)

%C 512: (10) 2056: (8,4) 2592: (2,4,6)

%C 514: (8,2) 2058: (8,2,2) 2594: (2,4,4,2)

%C (End)

%H Reinhard Zumkeller, <a href="/A062880/b062880.txt">Table of n, a(n) for n = 0..10000</a>

%H D. H. Bailey, J. M. Borwein, R. E. Crandall, and C. Pomerance, <a href="http://dx.doi.org/10.5802/jtnb.457">On the binary expansions of algebraic numbers</a>, J. Théor. Nombres Bordeaux, 16 (2004), 487-518.

%H S. Eigen, A. Hajian, and S. Kalikow, <a href="http://dx.doi.org/10.1007/BF02787185">Ergodic transformations and sequences of integers</a>, Israel J. Math. 75 (1991), 119-128; Math. Rev. 1147294 (93c:28014).

%F a(n) = 2 * A000695(n). - _Vladimir Shevelev_, Nov 07 2008

%F From _Robert Israel_, Apr 10 2018: (Start)

%F a(2*n) = 4*a(n).

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

%F G.f. g(x) satisfies: g(x) = 4*(1+x)*g(x^2)+2*x/(1-x^2). (End)

%p [seq(a(j),j=0..100)]; a := n -> add((floor(n/(2^i)) mod 2)*(2^((2*i)+1)),i=0..floor_log_2(n+1));

%t b[n_] := BitAnd[n, Sum[2^k, {k, 0, Log[2, n] // Floor, 2}]]; Select[Range[ 0, 10^4], b[#] == 0&] (* _Jean-François Alcover_, Feb 28 2016 *)

%o (Haskell)

%o a062880 n = a062880_list !! n

%o a062880_list = filter f [0..] where

%o f 0 = True

%o f x = (m == 0 || m == 2) && f x' where (x', m) = divMod x 4

%o -- _Reinhard Zumkeller_, Nov 20 2012

%o (C) uint32_t a_next(uint32_t a_n) { return (a_n + 0x55555556) & 0xaaaaaaaa; } /* _Falk Hüffner_, Jan 22 2022 */

%o (Python)

%o def A062880(n): return int(bin(n)[2:],4)<<1 # _Chai Wah Wu_, Aug 21 2023

%Y Cf. A000695.

%Y Except for first term, n such that A063694(n) = 0. Binary expansion is given in A062033.

%Y Interpreted as Zeckendorf expansion: A062879.

%Y Central diagonal of arrays A163357 and A163359.

%Y Even partitions are counted by A035363.

%Y Numbers with an even number of 1's in binary expansion are A001969.

%Y Numbers whose binary expansion has even length are A053754.

%Y All of the following pertain to compositions in standard order (A066099):

%Y - Length is A000120.

%Y - Compositions without even parts are A060142.

%Y - Sum is A070939.

%Y - Product is A124758.

%Y - Strict compositions are A233564.

%Y - Heinz number is A333219.

%Y - Number of distinct parts is A334028.

%K nonn,easy

%O 0,2

%A _Antti Karttunen_, Jun 26 2001

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 June 26 19:52 EDT 2024. Contains 373723 sequences. (Running on oeis4.)