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 A324495 #37 Jun 27 2022 08:15:27 %S A324495 1,3,4,7,9,9,10,15,18,18,20,18,20,20,21,31,37,37,40,37,40,40,41,37,40, %T A324495 40,41,40,41,41,42,63,74,74,78,74,78,78,80,74,78,78,80,78,80,80,82,74, %U A324495 78,78,80,78,80,80,82,78,80,80,82,80,82,82,83,127,147,147,153 %N A324495 Average number of steps t(n) required to get n by repeatedly toggling one of the ceiling(log_2(n)) bits of the binary result of the previous step at a random position with equal probability of the bit positions, starting with all bits 0. The fractional part of t is given separately, i.e., t(n) = a(n) + A324496(n)/A324497(n). %C A324495 The problem is related to random walks on the edges of n-dimensional hypercubes. %C A324495 a(n) is only dependent on the length of the binary representation A070939(n) and on the binary weight A000120(n). %H A324495 Hugo Pfoertner, <a href="/A324495/b324495.txt">Table of n, a(n) for n = 1..4096</a> %H A324495 P. Diaconis, R. L. Graham, J. A. Morrison, <a href="http://web.archive.org/web/20190917054306/https://statistics.stanford.edu/research/asymptotic-analysis-random-walk-hypercube-many-dimensions">Asymptotic Analysis of a Random Walk on a Hypercube with Many Dimensions</a>, Technical Report EFS NFS 307, Department of Statistics, Stanford University, December 1988. %H A324495 Persi Diaconis, R. L. Graham, J. A. Morrison, <a href="https://doi.org/10.1002/rsa.3240010105">Asymptotic analysis of a random walk on a hypercube with many dimensions"</a>, Random Structures & Algorithms, Volume 1, Issue 1, Pages 51-72, Spring 1990. %H A324495 IBM Research, <a href="https://www.research.ibm.com/haifa/ponderthis/challenges/April2006.html">Ponder This April 2006 - Challenge</a>, Random walks on an n-dimensional hypercube. %H A324495 IBM Research, <a href="https://www.research.ibm.com/haifa/ponderthis/solutions/April2006.html">Ponder This April 2006 - Challenge</a>, Solution. %e A324495 a(5) = 9 is given by the sum of occurrence probabilities of toggle chains of even lengths 2*k, multiplied by the lengths. %e A324495 a(5) = Sum_{k>=1} 4*k*7^(k-1) / 3^(2*k) = 9. %e A324495 The corresponding simulation results for 10^10 toggle chains are %e A324495 2*k Probability P 2*k*P Cumulated %e A324495 2 0.22222334 0.44444668 0.444447 %e A324495 4 0.17284183 0.69136731 1.135814 %e A324495 6 0.13442963 0.80657780 1.942392 %e A324495 8 0.10455718 0.83645746 2.778849 %e A324495 10 0.08131600 0.81315998 3.592009 %e A324495 ... %e A324495 196 0.00000000 0.00000002 9.000068 %e A324495 . %e A324495 a(7) = Sum_{k>=1} 2*(2*k+1)*7^(k-1) / 3^(2*k) = 10. %Y A324495 Cf. A000120, A003149, A070939, A099627, A324496, A324497. %K A324495 nonn %O A324495 1,2 %A A324495 _Hugo Pfoertner_, Mar 05 2019