login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

The binary expansion of a(n) is the reversal of the concatenation of the binary expansions of 1,...,n.
1

%I #33 Sep 30 2024 12:53:29

%S 1,3,27,59,1339,7483,122171,253243,19127611,186899771,7166221627,

%T 32936025403,1544764513595,16937927302459,544703508634939,

%U 1107653462056251,307352428123249979,5495499198854061371,466664101041592851771,3418143152835121110331,400096927713885319060795

%N The binary expansion of a(n) is the reversal of the concatenation of the binary expansions of 1,...,n.

%H Paolo Xausa, <a href="/A376295/b376295.txt">Table of n, a(n) for n = 1..400</a>

%F a(n) = A030101(A047778(n)).

%e For n = 4 a(4) = 59 because:

%e Concatenation: 1 10 11 100

%e Reversed order: 00111011

%e And 00111011 in base 10 is 59.

%t IntegerReverse[Module[{n = 1}, NestList[#*2^BitLength[++n] + n &, 1, 25]], 2] (* _Paolo Xausa_, Sep 30 2024 *)

%o (Python)

%o a = lambda n: int("".join(bin(x)[2:] for x in range(1,n+1))[::-1],2)

%o print([a(n) for n in range(1,22)])

%Y Cf. A030101, A047778.

%K nonn,base,easy

%O 1,2

%A _Darío Clavijo_, Sep 19 2024