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 A212591 #40 Dec 12 2021 22:11:09 %S A212591 0,1,2,5,8,9,10,21,32,33,34,37,40,41,42,85,128,129,130,133,136,137, %T A212591 138,149,160,161,162,165,168,169,170,341,512,513,514,517,520,521,522, %U A212591 533,544,545,546,549,552,553,554,597,640,641,642,645,648,649,650,661 %N A212591 a(n) is the smallest value of k for which A020986(k) = n. %C A212591 Brillhart and Morton derive an omega function for the largest values of k. This sequence appears to be given by a similar alpha function. %H A212591 Michael Day, <a href="/A212591/b212591.txt">Table of n, a(n) for n = 1..10000</a> %H A212591 J. Brillhart and P. Morton, <a href="http://www.maa.org/programs/maa-awards/writing-awards/a-case-study-in-mathematical-research-the-golay-rudin-shapiro-sequence">A case study in mathematical research: the Golay-Rudin-Shapiro sequence</a>, Amer. Math. Monthly, 103 (1996) 854-869. %H A212591 Kevin Ryde, <a href="http://user42.tuxfamily.org/alternate/index.html">Iterations of the Alternate Paperfolding Curve</a>, see index GRScumulFirstN. %F A212591 a(2*n-1) - a(2*n-2) = (2^(2*k+1)+1)/3 and a(2*n) - a(2*n-1) = (2^(2*k+1)+1)/3 with a(0) = a(1) = 0, where n = (2^k)*(2*m-1) for some integers k >= 0 and m > 0. %F A212591 Restating the formula above, a(n+1) - a(n) = A007583(A050605(n-1)) = A276391 with terms repeated. - _John Keith_, Mar 04 2021 %o A212591 (PARI) %o A212591 alpha(n)={ %o A212591 if(n<2, return(max(0,n-1))); %o A212591 local(nm1=n-1, %o A212591 mi=m=ceil(nm1/2), %o A212591 r=floor(log(m)/log(2)), %o A212591 i,fi,alpha=0,a); %o A212591 forstep(i=1, 2*r+1, 2, %o A212591 mi/=2; %o A212591 fi=(1+2^i)\3; %o A212591 alpha+=fi*floor(0.5+mi); %o A212591 ); %o A212591 alpha*=2; %o A212591 if(nm1%2, \\ adjust for even n %o A212591 a=factor(2*m)[1,2]-1; %o A212591 alpha-= (1+2^(1+2*a))\3; %o A212591 ); %o A212591 return(alpha); %o A212591 } %o A212591 (J) %o A212591 NB. J function on a vector %o A212591 NB. Beware round-off errors on large arguments %o A212591 NB. ok up to ~ 1e8 %o A212591 alphav =: 3 : 0 %o A212591 n =. <: y %o A212591 if.+/ ntlo=. n > 0 do. %o A212591 n =. ntlo#n %o A212591 m =. >.-: n %o A212591 r =. <.2^.m %o A212591 f =. <.3%~2+2^2*>:i.>./>:r %o A212591 z =. 0 %o A212591 mi =. m %o A212591 for_i. i.#f do. %o A212591 z =. z + (i{f) * <.0.5 + mi =. mi%2 %o A212591 end. %o A212591 nzer=. (+/ @: (0=>./\)@:|.)"1 @: #: m %o A212591 ntlo #^:_1 z - (2|n) * <.-:nzer{f %o A212591 else. %o A212591 ntlo %o A212591 end. %o A212591 ) %o A212591 NB. eg alphav 1 3 5 100 2 8 33 %Y A212591 Cf. A020985, A020991, A020986. %K A212591 nonn %O A212591 1,3 %A A212591 _Michael Day_, May 22 2012 %E A212591 Minor edits by _N. J. A. Sloane_, Jun 06 2012