A062880 Zero together with the numbers which can be written as a sum of distinct odd powers of 2.
0, 2, 8, 10, 32, 34, 40, 42, 128, 130, 136, 138, 160, 162, 168, 170, 512, 514, 520, 522, 544, 546, 552, 554, 640, 642, 648, 650, 672, 674, 680, 682, 2048, 2050, 2056, 2058, 2080, 2082, 2088, 2090, 2176, 2178, 2184, 2186, 2208, 2210, 2216, 2218, 2560, 2562
Offset: 0
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
- D. H. Bailey, J. M. Borwein, R. E. Crandall, and C. Pomerance, On the binary expansions of algebraic numbers, J. Théor. Nombres Bordeaux, 16 (2004), 487-518.
- S. Eigen, A. Hajian, and S. Kalikow, Ergodic transformations and sequences of integers, Israel J. Math. 75 (1991), 119-128; Math. Rev. 1147294 (93c:28014).
Crossrefs
Cf. A000695.
Interpreted as Zeckendorf expansion: A062879.
Even partitions are counted by A035363.
Numbers with an even number of 1's in binary expansion are A001969.
Numbers whose binary expansion has even length are A053754.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Compositions without even parts are A060142.
- Sum is A070939.
- Product is A124758.
- Strict compositions are A233564.
- Heinz number is A333219.
- Number of distinct parts is A334028.
Programs
-
C
uint32_t a_next(uint32_t a_n) { return (a_n + 0x55555556) & 0xaaaaaaaa; } /* Falk Hüffner, Jan 22 2022 */
-
Haskell
a062880 n = a062880_list !! n a062880_list = filter f [0..] where f 0 = True f x = (m == 0 || m == 2) && f x' where (x', m) = divMod x 4 -- Reinhard Zumkeller, Nov 20 2012
-
Maple
[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));
-
Mathematica
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 *)
-
Python
def A062880(n): return int(bin(n)[2:],4)<<1 # Chai Wah Wu, Aug 21 2023
Formula
a(n) = 2 * A000695(n). - Vladimir Shevelev, Nov 07 2008
From Robert Israel, Apr 10 2018: (Start)
a(2*n) = 4*a(n).
a(2*n+1) = 4*a(n)+2.
G.f. g(x) satisfies: g(x) = 4*(1+x)*g(x^2)+2*x/(1-x^2). (End)
Comments