login
A393076
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
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, 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, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0
OFFSET
0,1
COMMENTS
For odd n, s_n is palindromic because if s_n = xPx then s_{n+2} = PxxPxPxxP.
a(n) is also the central bit in s_{n+1}.
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.
LINKS
FORMULA
For n > 0, a(2*n) = a(2*n-1).
EXAMPLE
s_1 = reverse(10..1) = 101 (where .. is concatenation), so a(1) = 1.
s_2 = reverse(101..10) = 01101, so a(2) = 1.
s_3 = reverse(01101..0110) = 011010110, so a(3) = 0.
Eight more terms can be obtained directly from s_3, without constructing s_4:
a(n) 0 1 1 0 1 0 1 1 0 <- this is s_3
n 4 6 8 10 11 9 7 5 3
PROG
(Python)
s, sr, a = 0b10, 0b01, []
for i in range(11):
a += [s&1]
s, sr = ((sr&((1<<(2**i))-1))<<(2**i+1))+sr, (s<<(2**i))+(s>>1)
for i in range(100):
a += [s&1, s&1]
s >>= 1
print(a)
CROSSREFS
Related to A282390.
A334820 is defined by the same rule without reversion.
Sequence in context: A189135 A369961 A219189 * A029691 A209229 A365089
KEYWORD
nonn
AUTHOR
Andrei Zabolotskii, Jan 31 2026
STATUS
approved