login
Numbers t whose binary expansion Sum 2^e_i has exponents e_i which are odious numbers (A000069).
4

%I #52 Aug 11 2025 10:25:40

%S 0,2,4,6,16,18,20,22,128,130,132,134,144,146,148,150,256,258,260,262,

%T 272,274,276,278,384,386,388,390,400,402,404,406,2048,2050,2052,2054,

%U 2064,2066,2068,2070,2176,2178,2180,2182,2192,2194,2196,2198,2304,2306,2308,2310,2320,2322,2324,2326,2432,2434,2436,2438,2448,2450,2452,2454

%N Numbers t whose binary expansion Sum 2^e_i has exponents e_i which are odious numbers (A000069).

%C These t in binary representation have 1s only in positions with 0s in the Thue-Morse sequence (A010059) with beginning of that sequence corresponding to least significant bit. a(n) can be derived from n by placing the bits of n into a(n) at those permitted positions.

%C a(n) can be represented in base 4 equal to binary representation of n with each digit multiplied by 1 or 2 according to the 1-2 Thue-Morse sequence A001285 starting in the least significant digit and transforming 1->2, and 2->1.

%C Any pair 2*p and 2*p+1 has one evil and the other odious number, so the bit at position p in n goes to either 2*p or 2*p+1 in a(n), according as which of those is odious.

%C Every integer k>=0 corresponds to a unique pair i,j with k = x(i) + y(j), with x(i)=a(i) and y(j)=A380009(j).

%C Sequences x(n) and y(n) have same growth rate and cross an infinite number of times.

%C Coordinate pairs (i,j), define a Morton space-filling curve, similar to Z-order curve.

%H Luis Rato, <a href="/A380008/a380008.png">Plot of an NZ-order curve</a>, containing the integers from 0 to 255.

%H Wikipedia, Morton code map, also known as <a href="https://en.wikipedia.org/wiki/Z-order_curve">Z-order curve</a>.

%e Considering the representation in base 4,

%e For n=11 = 1011_binary, a(11) -> 1021_base4 -> 2012_base4 = 134.

%e For n=12 = 1100_binary, a(12) -> 1200_base4 -> 2100_base4 = 144.

%e Considering all numbers are decomposed in binary, with exponents belonging to odious numbers: 1, 2, 4, 7,...

%e The sequence of terms together with their binary representation begins:

%e n a(n) a(n)_bin

%e 0 0: 0 ~ 0

%e 1 2: 10 ~ 2^1

%e 2 4: 100 ~ 2^2

%e 3 6: 110 ~ 2^2+2^1

%e 4 16: 10000 ~ 2^4

%e 5 18: 10010 ~ 2^4 +2^1

%e 6 20: 10100 ~ 2^4+2^2

%e 7 22: 10110 ~ 2^4+2^2+2^1

%e 8 128: 10000000 ~ 2^7

%e 9 130: 10000010 ~ 2^7 +2^1

%e 10 132: 10000100 ~ 2^7 +2^2

%e 11 134: 10000110 ~ 2^7 +2^2+2^1

%e 12 144: 10010000 ~ 2^7+2^4

%o (PARI) a(n) = { my (v = 0, e); while (n, n -= 2^e = exponent(n); v += 2^(2*e + if (hammingweight(e)%2, 0, 1));); return (v); } \\ _Rémy Sigrist_, Feb 02 2025

%o (PARI) isok(t) = my(b=Vecrev(binary(t))); for (i=1, #b, if (b[i] && !(hammingweight(i-1)%2), return(0))); return(1); \\ _Michel Marcus_, Feb 10 2025

%Y Cf. A000069, A001285, A010059, A380009.

%K base,easy,nonn

%O 0,2

%A _Luis Rato_, Jan 08 2025