OFFSET

1,4

COMMENTS

This is the number of distinct binary words w of length n that eventually cycle under the Post tag system (see A284116, A289670) reduced to take into account the observation made by Don Reble that (if the bits of w are labeled from the left starting at bit 0) bits 1,2,4,5,7,8,... (not a multiple of 3) are "junk DNA" and have no effect on the outcome.

PROG

(Python)

from __future__ import division

def A289677(n):

c, k, r, n2, cs, ts = 0, 1+(n-1)//3, 2**((n-1) % 3), 2**(n-1), set(), set()

for i in range(2**k):

j, l = int(bin(i)[2:], 8)*r, n2

traj = set([(l, j)])

while True:

if j >= l:

j = j*16+13

l *= 2

else:

j *= 4

l //= 2

if l == 0:

ts |= traj

break

j %= 2*l

if (l, j) in traj:

c += 1

cs |= traj

break

if (l, j) in cs:

c += 1

break

if (l, j) in ts:

break

traj.add((l, j))

return c # Chai Wah Wu, Aug 03 2017

CROSSREFS

KEYWORD

nonn

AUTHOR

N. J. A. Sloane, Aug 01 2017

STATUS

approved