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 A232013 #34 Oct 19 2024 15:57:32 %S A232013 4,1,12,4,13,14,11,10 %N A232013 Number of iterations of A176341 ("position of n in Pi") until a value is reached for the second time, when starting with n, or -1 if no value is repeated. %C A232013 See A232014 for a variant based on A032445 instead of A176341. %C A232013 Some loops: (1), (711939213), (0, 32, 15, 3), (19, 37, 46), (40, 70, 96, 180, 3664, 24717, 15492, 84198, 65489, 3725, 16974, 41702, 3788, 5757, 1958, 14609, 62892, 44745, 9385, 169). %C A232013 See Hans Havermann table (in links) for primary unknown-length evolutions. %H A232013 David G. Andersen, <a href="http://www.angio.net/pi">Loop Sequences within Pi, on The Pi-Search Page</a> (Search 2*10^8 decimal digits of Pi). %H A232013 Hans Havermann, <a href="http://chesswanks.com/seq/a232013.txt">Information table of n, a(n) for n=0..100</a>. %H A232013 Joaquin Navarro, <a href="http://images-archive.math.cnrs.fr/Les-secrets-du-nombre-Pi.html">Les secrets du nombre Pi</a> (Book review, in French). %H A232013 James Taylor, <a href="http://www.subidiom.com/pi/">Irrational Numbers Search Engine</a> (Search 2*10^9 decimal digits of Pi). %H A232013 Ady Tzidon, <a href="http://perplexus.info/show.php?pid=7746&op=sol">Loops in Pi</a>. %e A232013 a(0)=4 since A176341(0)=32 (position of the first "0" in Pi's digits), A176341(32)=15 (position of the first "32" in Pi's digits), A176341(15)=3 (position of the first "15" in Pi's digits), A176341(3)=0 (position of the first "3" in Pi's digits); here we find the "0" again after 4 iterations, thus a(0)=4. %e A232013 a(1)=1 since A176341(1)=1 (the first "1" occurs at position 1 in Pi's digits), which already "closes the loop" after 1 iteration. %e A232013 a(2)=12 because the iterations yield 2 > 6 > 7 > 13 > 110 > 174 > 155 > 314 > 0 > 32 > 15 > 3 > 0, here we re-enter the loop (of length 4) after 12 iterations. %t A232013 pidigits = First[RealDigits[N[Pi, 10^6]]]; %t A232013 Table[ lst = {}; test = n; steps = 1; %t A232013 While[AppendTo[lst, test]; ! %t A232013 MemberQ[lst, %t A232013 test = First[ %t A232013 First[SequencePosition[pidigits, IntegerDigits[test], 1]]] - 1], %t A232013 steps++ ]; steps, {n, 0, 7}] (* _Robert Price_, Aug 31 2019 *) %o A232013 (PARI) A232013(n)={my(u=0);for(i=1,9e9,u+=1<<n;bittest(u,n=A176341(n))&&return(i))} %K A232013 nonn,base,more %O A232013 0,1 %A A232013 _M. F. Hasler_, Nov 16 2013 %E A232013 Edited by _Hans Havermann_, Aug 01 2014