cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A289677 a(n) = A289671(n)/2^f(n), where f(n) = 2*floor((n-1)/3) + ((n+2) mod 3) = A004523(n).

This page as a plain text file.
%I A289677 #33 Sep 23 2021 01:26:49
%S A289677 0,1,1,2,2,3,4,4,5,11,12,13,22,19,20,43,46,44,85,88,89,171,185,192,
%T A289677 366,380,396,774,793,814,1586,1589,1610,3136,3106,3130,6123,6078,6103,
%U A289677 12088,12147,12229,24283,24534,24736,49040,49482,49879,99031,99792,100747,200444,201892,203765,405931,408478,411403
%N A289677 a(n) = A289671(n)/2^f(n), where f(n) = 2*floor((n-1)/3) + ((n+2) mod 3) = A004523(n).
%C A289677 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.
%o A289677 (Python)
%o A289677 from __future__ import division
%o A289677 def A289677(n):
%o A289677     c, k, r, n2, cs, ts = 0, 1+(n-1)//3, 2**((n-1) % 3), 2**(n-1), set(), set()
%o A289677     for i in range(2**k):
%o A289677         j, l = int(bin(i)[2:],8)*r, n2
%o A289677         traj = set([(l,j)])
%o A289677         while True:
%o A289677             if j >= l:
%o A289677                 j = j*16+13
%o A289677                 l *= 2
%o A289677             else:
%o A289677                 j *= 4
%o A289677                 l //= 2
%o A289677             if l == 0:
%o A289677                 ts |= traj
%o A289677                 break
%o A289677             j %= 2*l
%o A289677             if (l,j) in traj:
%o A289677                 c += 1
%o A289677                 cs |= traj
%o A289677                 break
%o A289677             if (l,j) in cs:
%o A289677                 c += 1
%o A289677                 break
%o A289677             if (l,j) in ts:
%o A289677                 break
%o A289677             traj.add((l,j))
%o A289677     return c # _Chai Wah Wu_, Aug 03 2017
%Y A289677 Cf. A284116, A284119, A284121, A289670, A289671, A289672, A289673, A289674, A289675, A289676.
%Y A289677 Cf. also A290436-A290441.
%K A289677 nonn
%O A289677 1,4
%A A289677 _N. J. A. Sloane_, Aug 01 2017
%E A289677 Corrected by _Don Reble_, Aug 01 2017 (there were errors in A289671).