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.
%I A086876 #18 Sep 02 2023 19:06:10 %S A086876 1,1,2,2,2,2,2,4,2,2,4,4,4,2,2,4,4,4,4,4,4,4,2,2,4,4,4,4,4,4,4,4,4,4, %T A086876 4,4,4,6,2,2,2,4,4,4,4,4,4,4,4,4,4,4,4,4,6,2,4,4,4,4,4,4,6,4,6,6,6,6, %U A086876 6,2,2,4,4,4,4,4,4,4,4,4,4,4,4,4,6,2,4,4,4,4,4,4,6,4,6,6,6 %N A086876 Run lengths in A071542. %C A086876 All a(n) are even for n>1. %C A086876 Although this can be viewed as a list, the indexing still starts from zero, because a(n) tells from how many starting values one can end to 0 in n steps, with the iterative process described in A071542 (if going around in 0->0 loop is disallowed). I.e., a(n) gives the number of all nodes (whether internal or leaves) in "beanstalk" (see A179016) from which the distance to the root (zero) is n. %C A086876 Records occur at positions { 1,2,7,37,122,... } which correspond to run start positions { 2,4,16,126,512,... } in A071542. %H A086876 Antti Karttunen, <a href="/A086876/b086876.txt">Table of n, a(n) for n = 0..8728</a> %e A086876 There is only one way to reach 0 in 0 steps from anywhere, and that is from 0 itself. %e A086876 There is only one way to reach 0 in 1 steps from anywhere (with no 0->0 transition allowed), and that is from 1, as 1-A000120(1)=0. %e A086876 There are two ways to reach 0 in 2 steps, from 2, as 2-A000120(2)=1, and 1-A000120(1)=0, and from 3, as 3-A000120(3)=1, and 1-A000120(1)=0. %e A086876 Thus a(0)=a(1)=1 and a(2)=2. %o A086876 (PARI) %o A086876 e1(n)=sum(k=0, floor(log(n)/log(2)), bittest(n, k)) %o A086876 f(n)=local(c); c=0; while(n, n=n-e1(n); c=c+1); c %o A086876 p=1; r=1; for(n=1, 150, c=0; while(f(r) == p, r=r+1; c=c+1); p=f(r); print1(c", ")) %Y A086876 Essentially the first differences of both A173601 and A213708. %K A086876 nonn,easy %O A086876 0,3 %A A086876 _Ralf Stephan_, Aug 21 2003 %E A086876 Changed the starting offset by prepending a(0)=1 (with the indexing of the rest of terms thus not changed), as A071542 now contains an initial zero. - _Antti Karttunen_, Nov 02 2012