A377029 a(1) = 0; thereafter in the binary expansion of a(n-1), expand bits: 1->01 and 0->10.
0, 2, 6, 22, 406, 92566, 6818458006, 26055178074437806486, 540213899028732737068658940860686756246, 163551003506862550406254063077517364557434408527734307437037618419534882498966
Offset: 1
Examples
For n = 5 a(5) = 406 because: This encoding results in the following tree: n | a(n) --+--------------- 1 | 0 | |\ 2 | 1 0 | | | 3 | 1 10 | | | \ 4 | 1 01 10-- | | |\ \ \ | | | \ \ \ 5 | 1 10 01 01 10 Which also aligns bitwise to the right: n | a(n) --+----------- 1 | 0 2 | 10 3 | 110 4 | 10110 5 | 110010110 And 110010110 in base 10 is 406.
Links
- Darío Clavijo, Table of n, a(n) for n = 1..13
Programs
-
Mathematica
NestList[FromDigits[2 - IntegerDigits[#, 2], 4] &, 0, 10] (* Paolo Xausa, Nov 04 2024 *)
-
Python
from functools import cache A374625 = lambda n: int(bin(n)[2:].replace('0', '2'), 4) @cache def a(n): if n == 1: return 0 return A374625(a(n-1)) print([a(n) for n in range(1, 12)])
Formula
a(n) = A320916(2^(n-2)+1) for n > 1.
a(n) = A374625(a(n-1)) for n > 1. - Paolo Xausa, Nov 04 2024
Comments