login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A084186 First occurrence of exactly n 1's in the binary expansion of sqrt(2). 5

%I #27 Feb 15 2024 17:28:10

%S 1,3,40,17,74,265,31,336,11937,1403,8894,3524,33223,126903,3067,

%T 109312,390536,553171,280266,962560,1747112,1740081,30793169,13109551,

%U 118101037,1077718187,44908294,1528865059,1647265647,3913429742,10501492774,4702573600,81557258556,107498528405

%N First occurrence of exactly n 1's in the binary expansion of sqrt(2).

%H Nick Hobson, <a href="/A084186/a084186.c.txt">C program</a>

%e The binary expansion of sqrt(2) is 1.0110101000001..(A004539) and at position 17, there are four 1's, framed by 0's, so a(4)=17.

%o (Python)

%o from itertools import count

%o from math import isqrt

%o def A084186(n):

%o a, b = 2, (1<<n+2)-1

%o c = (b>>1)^1

%o for k in count(1-n):

%o if isqrt(a)&b==c:

%o return k

%o a<<=2 # _Chai Wah Wu_, Jan 24 2024

%o (C) See Links section.

%Y Cf. A084185, A084187.

%Y Cf. A233836.

%K base,nonn,hard

%O 1,2

%A _Ralf Stephan_, May 18 2003

%E a(21)-a(29) from _Chai Wah Wu_, Jan 25 2024

%E a(30)-a(34) from _Nick Hobson_, Feb 15 2024

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 03:30 EDT 2024. Contains 371782 sequences. (Running on oeis4.)