CINXE.COM
A084187 - OEIS
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <head> <link rel="stylesheet" href="/styles.css"> <meta name="format-detection" content="telephone=no"> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name=viewport content="width=device-width, initial-scale=1"> <meta name="keywords" content="OEIS,integer sequences,Sloane" /> <title>A084187 - OEIS</title> <link rel="search" type="application/opensearchdescription+xml" title="OEIS" href="/oeis.xml"> <script> var myURL = "\/A084187" function redir() { var host = document.location.hostname; if(host != "oeis.org" && host != "127.0.0.1" && !/^([0-9.]+)$/.test(host) && host != "localhost" && host != "localhost.localdomain") { document.location = "https"+":"+"//"+"oeis"+".org/" + myURL; } } function sf() { if(document.location.pathname == "/" && document.f) document.f.q.focus(); } </script> </head> <body bgcolor=#ffffff onload="redir();sf()"> <div class=loginbar> <div class=login> <a href="/login?redirect=%2fA084187">login</a> </div> </div> <div class=center><div class=top> <center> <div class=donors> The OEIS is supported by <a href="http://oeisf.org/#DONATE">the many generous donors to the OEIS Foundation</a>. </div> <div class=banner> <a href="/"><img class=banner border="0" width="600" src="/banner2021.jpg" alt="A084187 - OEIS"></a> </div> </center> </div></div> <div class=center><div class=pagebody> <div class=searchbarcenter> <form name=f action="/search" method="GET"> <div class=searchbargreet> <div class=searchbar> <div class=searchq> <input class=searchbox maxLength=1024 name=q value="" title="Search Query"> </div> <div class=searchsubmit> <input type=submit value="Search" name=go> </div> <div class=hints> <span class=hints><a href="/hints.html">Hints</a></span> </div> </div> <div class=searchgreet> (Greetings from <a href="/welcome">The On-Line Encyclopedia of Integer Sequences</a>!) </div> </div> </form> </div> <div class=sequence> <div class=space1></div> <div class=line></div> <div class=seqhead> <div class=seqnumname> <div class=seqnum> A084187 </div> <div class=seqname> First occurrence of exactly n 0's in the binary expansion of sqrt(2). </div> </div> <div class=scorerefs> 4 </div> </div> <div> <div class=seqdatabox> <div class=seqdata>2, 15, 63, 58, 9, 1003, 524, 454, 1303, 5335, 22472, 8882, 37469, 32279, 220311, 92988, 698343, 24002, 574131, 3333660, 5940559, 4079882, 8356569, 115885798, 76570753, 202460870, 1034477781, 457034356, 1005210009, 3753736439, 2204906858, 50747186116, 32242071604, 159423417084, 114244391078, 74632918239</div> <div class=seqdatalinks> (<a href="/A084187/list">list</a>; <a href="/A084187/graph">graph</a>; <a href="/search?q=A084187+-id:A084187">refs</a>; <a href="/A084187/listen">listen</a>; <a href="/history?seq=A084187">history</a>; <a href="/search?q=id:A084187&fmt=text">text</a>; <a href="/A084187/internal">internal format</a>) </div> </div> </div> <div class=entry> <div class=section> <div class=sectname>OFFSET</div> <div class=sectbody> <div class=sectline>1,1</div> </div> </div> <div class=section> <div class=sectname>LINKS</div> <div class=sectbody> <div class=sectline><a href="/A084187/b084187.txt">Table of n, a(n) for n=1..36.</a></div> </div> </div> <div class=section> <div class=sectname>EXAMPLE</div> <div class=sectbody> <div class=sectline>The binary expansion of sqrt(2) is 1.0110101000001..(<a href="/A004539" title="Expansion of sqrt(2) in base 2.">A004539</a>) and at position 9, there are five 0's, framed by 1's, so a(5)=9.</div> </div> </div> <div class=section> <div class=sectname>MATHEMATICA</div> <div class=sectbody> <div class=sectline>With[{d=RealDigits[Sqrt[2], 2, 116*10^6][[1]]}, Flatten[Table[SequencePosition[d, Join[ {1}, PadRight[{}, n, 0], {1}], 1][[All, 1]], {n, 25}]]]+1 (* <a href="/wiki/User:Harvey_P._Dale">Harvey P. Dale</a>, Dec 12 2022 *)</div> </div> </div> <div class=section> <div class=sectname>PROG</div> <div class=sectbody> <div class=sectline>(Python)</div> <div class=sectline>from math import isqrt</div> <div class=sectline>from itertools import count</div> <div class=sectline>def <a href="/A084187" title="First occurrence of exactly n 0's in the binary expansion of sqrt(2).">A084187</a>(n):</div> <div class=sectline> a, b = 2, (1<<n+2)-1</div> <div class=sectline> c = (b+1>>1)|1</div> <div class=sectline> for k in count(1-n):</div> <div class=sectline> if isqrt(a)&b==c:</div> <div class=sectline> return k</div> <div class=sectline> a<<=2 # <a href="/wiki/User:Chai_Wah_Wu">Chai Wah Wu</a>, Jan 25 2024</div> <div class=sectline>(C) See Links section of <a href="/A084186" title="First occurrence of exactly n 1's in the binary expansion of sqrt(2).">A084186</a>.</div> </div> </div> <div class=section> <div class=sectname>CROSSREFS</div> <div class=sectbody> <div class=sectline>Cf. <a href="/A084185" title="First occurrence of binary n in the binary expansion of sqrt(2).">A084185</a>, <a href="/A084186" title="First occurrence of exactly n 1's in the binary expansion of sqrt(2).">A084186</a>.</div> <div class=sectline>Cf. <a href="/A233836" title="Run lengths of ones and zeros in binary expansion of sqrt(2), cf. A004539.">A233836</a>.</div> <div class=sectline>Sequence in context: <a href="/A296661" title="a(n) = (exp(k)*Gamma(1+n, k) - exp(-k)*Gamma(1+n, -k))/k! for k = 3.">A296661</a> <a href="/A000181" title="Coefficients of m茅nage hit polynomials.">A000181</a> <a href="/A047146" title="T(n,n+1), array T as in A047140.">A047146</a> * <a href="/A267596" title="Decimal representation of the n-th iteration of the "Rule 173" elementary cellular automaton starting with a single ON (blac...">A267596</a> <a href="/A119904" title="Where records occur in A118878.">A119904</a> <a href="/A271828" title="a(n) = 4*n^3 - 18*n^2 + 27*n - 12.">A271828</a></div> <div class=sectline>Adjacent sequences: <a href="/A084184" title="Partial sums of a Jacobsthal related sequence.">A084184</a> <a href="/A084185" title="First occurrence of binary n in the binary expansion of sqrt(2).">A084185</a> <a href="/A084186" title="First occurrence of exactly n 1's in the binary expansion of sqrt(2).">A084186</a> * <a href="/A084188" title="a(0)=1, a(n+1) = 2*a(n) + b(n+2), where b(n)=A004539(n) is the n-th bit in the binary expansion of sqrt(2).">A084188</a> <a href="/A084189" title="Minimum digit out of both prime factors of the numbers in A046376.">A084189</a> <a href="/A084190" title="Least common multiple of {d-1: d > 1 and d divides n}.">A084190</a></div> </div> </div> <div class=section> <div class=sectname>KEYWORD</div> <div class=sectbody> <div class=sectline><span title="a sequence of nonnegative numbers">nonn</span>,<span title="next term not known, may be hard to find. please extend this sequence">hard</span></div> </div> </div> <div class=section> <div class=sectname>AUTHOR</div> <div class=sectbody> <div class=sectline><a href="/wiki/User:Ralf_Stephan">Ralf Stephan</a>, May 18 2003</div> </div> </div> <div class=section> <div class=sectname>EXTENSIONS</div> <div class=sectbody> <div class=sectline>More terms from <a href="/wiki/User:Ryan_Propper">Ryan Propper</a>, May 09 2006</div> <div class=sectline>a(26)-a(29) from <a href="/wiki/User:Chai_Wah_Wu">Chai Wah Wu</a>, Jan 25 2024</div> <div class=sectline>a(30)-a(36) from <a href="/wiki/User:Nick_Hobson">Nick Hobson</a>, Feb 15 2024</div> </div> </div> <div class=section> <div class=sectname>STATUS</div> <div class=sectbody> <div class=sectline>approved</div> </div> </div> </div> <div class=space10></div> </div> </div></div> <p> <div class=footerpad></div> <div class=footer> <center> <div class=bottom> <div class=linksbar> <a href="/">Lookup</a> <a href="/wiki/Welcome"><font color="red">Welcome</font></a> <a href="/wiki/Main_Page"><font color="red">Wiki</font></a> <a href="/wiki/Special:RequestAccount">Register</a> <a href="/play.html">Music</a> <a href="/plot2.html">Plot 2</a> <a href="/demo1.html">Demos</a> <a href="/wiki/Index_to_OEIS">Index</a> <a href="/webcam">WebCam</a> <a href="/Submit.html">Contribute</a> <a href="/eishelp2.html">Format</a> <a href="/wiki/Style_Sheet">Style Sheet</a> <a href="/transforms.html">Transforms</a> <a href="/ol.html">Superseeker</a> <a href="/recent">Recents</a> </div> <div class=linksbar> <a href="/community.html">The OEIS Community</a> </div> <div class=linksbar> Maintained by <a href="http://oeisf.org">The OEIS Foundation Inc.</a> </div> <div class=dbinfo>Last modified February 17 16:29 EST 2025. Contains 380975 sequences.</div> <div class=legal> <a href="/wiki/Legal_Documents">License Agreements, Terms of Use, Privacy Policy</a> </div> </div> </center> </div> </body> </html>