This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A377029 #54 Jan 18 2025 21:58:11 %S A377029 0,2,6,22,406,92566,6818458006,26055178074437806486, %T A377029 540213899028732737068658940860686756246, %U A377029 163551003506862550406254063077517364557434408527734307437037618419534882498966 %N A377029 a(1) = 0; thereafter in the binary expansion of a(n-1), expand bits: 1->01 and 0->10. %C A377029 All terms are even and leading zeros omitted in the final encoding. %C A377029 Conversely the opposite mapping of bits: 0->01 and 1->10 is A133468. %C A377029 The bit length of a(n) is 2^(n-1)+1. %C A377029 The count of bits set for a(n) is A094373(n). %C A377029 a(n) = 2 (mod 4) for n > 1. %C A377029 Also all the terms align bitwise to the right. %C A377029 The hamming distance of a(n) and a(n+1) is in A000079. %H A377029 Darío Clavijo, <a href="/A377029/b377029.txt">Table of n, a(n) for n = 1..13</a> %F A377029 a(n) = A320916(2^(n-2)+1) for n > 1. %F A377029 A000120(a(n+1) XOR a(n)) = A000079(n-2). %F A377029 a(n) = A374625(a(n-1)) for n > 1. - _Paolo Xausa_, Nov 04 2024 %e A377029 For n = 5 a(5) = 406 because: %e A377029 This encoding results in the following tree: %e A377029 n | a(n) %e A377029 --+--------------- %e A377029 1 | 0 %e A377029 | |\ %e A377029 2 | 1 0 %e A377029 | | | %e A377029 3 | 1 10 %e A377029 | | | \ %e A377029 4 | 1 01 10-- %e A377029 | | |\ \ \ %e A377029 | | | \ \ \ %e A377029 5 | 1 10 01 01 10 %e A377029 Which also aligns bitwise to the right: %e A377029 n | a(n) %e A377029 --+----------- %e A377029 1 | 0 %e A377029 2 | 10 %e A377029 3 | 110 %e A377029 4 | 10110 %e A377029 5 | 110010110 %e A377029 And 110010110 in base 10 is 406. %t A377029 NestList[FromDigits[2 - IntegerDigits[#, 2], 4] &, 0, 10] (* _Paolo Xausa_, Nov 04 2024 *) %o A377029 (Python) %o A377029 from functools import cache %o A377029 A374625 = lambda n: int(bin(n)[2:].replace('0', '2'), 4) %o A377029 @cache %o A377029 def a(n): %o A377029 if n == 1: return 0 %o A377029 return A374625(a(n-1)) %o A377029 print([a(n) for n in range(1, 12)]) %Y A377029 Cf. A000051, A000079, A000120, A094373, A133468, A320916, A374625. %K A377029 nonn,base,easy %O A377029 1,2 %A A377029 _Darío Clavijo_, Oct 13 2024