login
a(n) is the last bit in the bit string s_n, where s_0 is 10 and s_n is the concatenation of s_{n-1} with itself with the last bit removed and then reversed.
3

%I #11 Feb 06 2026 09:05:09

%S 0,1,1,0,0,1,1,1,1,0,0,1,1,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,1,1,0,0,1,

%T 1,1,1,0,0,1,1,1,1,0,0,1,1,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,1,1,0,0,1,

%U 1,1,1,1,1,1,1,0,0,1,1,0,0,1,1,1,1,0,0

%N a(n) is the last bit in the bit string s_n, where s_0 is 10 and s_n is the concatenation of s_{n-1} with itself with the last bit removed and then reversed.

%C For odd n, s_n is palindromic because if s_n = xPx then s_{n+2} = PxxPxPxxP.

%C a(n) is also the central bit in s_{n+1}.

%C For any given n, the next 2^n terms after a(n) can be obtained by alternatingly reading the bits from the end and from the start of s_n.

%H Andrei Zabolotskii, <a href="/A393076/b393076.txt">Table of n, a(n) for n = 0..20000</a>

%F For n > 0, a(2*n) = a(2*n-1).

%e s_1 = reverse(10..1) = 101 (where .. is concatenation), so a(1) = 1.

%e s_2 = reverse(101..10) = 01101, so a(2) = 1.

%e s_3 = reverse(01101..0110) = 011010110, so a(3) = 0.

%e Eight more terms can be obtained directly from s_3, without constructing s_4:

%e a(n) 0 1 1 0 1 0 1 1 0 <- this is s_3

%e n 4 6 8 10 11 9 7 5 3

%o (Python)

%o s, sr, a = 0b10, 0b01, []

%o for i in range(11):

%o a += [s&1]

%o s, sr = ((sr&((1<<(2**i))-1))<<(2**i+1))+sr, (s<<(2**i))+(s>>1)

%o for i in range(100):

%o a += [s&1, s&1]

%o s >>= 1

%o print(a)

%Y Related to A282390.

%Y A334820 is defined by the same rule without reversion.

%K nonn

%O 0,1

%A _Andrei Zabolotskii_, Jan 31 2026