login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A377029
a(1) = 0; thereafter in the binary expansion of a(n-1), expand bits: 1->01 and 0->10.
1
0, 2, 6, 22, 406, 92566, 6818458006, 26055178074437806486, 540213899028732737068658940860686756246, 163551003506862550406254063077517364557434408527734307437037618419534882498966
OFFSET
1,2
COMMENTS
All terms are even and leading zeros omitted in the final encoding.
Conversely the opposite mapping of bits: 0->01 and 1->10 is A133468.
The bit length of a(n) is 2^(n-1)+1.
The count of bits set for a(n) is A094373(n).
a(n) = 2 (mod 4) for n > 1.
Also all the terms align bitwise to the right.
The hamming distance of a(n) and a(n+1) is in A000079.
LINKS
FORMULA
a(n) = A320916(2^(n-2)+1) for n > 1.
A000120(a(n+1) XOR a(n)) = A000079(n-2).
a(n) = A374625(a(n-1)) for n > 1. - Paolo Xausa, Nov 04 2024
EXAMPLE
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.
MATHEMATICA
NestList[FromDigits[2 - IntegerDigits[#, 2], 4] &, 0, 10] (* Paolo Xausa, Nov 04 2024 *)
PROG
(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)])
KEYWORD
nonn,base,easy,changed
AUTHOR
Darío Clavijo, Oct 13 2024
STATUS
approved