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!)
A272679 a(n)^2 is the smallest square whose binary expansion begins with the binary expansion of n. 5

%I #19 May 23 2016 08:04:55

%S 0,1,2,5,2,9,5,11,4,3,9,19,5,21,15,11,4,33,6,25,9,13,19,39,7,5,29,21,

%T 15,61,11,45,8,23,33,67,6,49,35,25,9,73,13,53,107,19,77,39,79,7,10,81,

%U 29,83,59,21,15,43,61,87,11,89,63,45,8,129,23,93,33,47

%N a(n)^2 is the smallest square whose binary expansion begins with the binary expansion of n.

%D Allan C. Wechsler, posting to math-fun mailing list May 22 2016.

%H Chai Wah Wu, <a href="/A272679/b272679.txt">Table of n, a(n) for n = 0..10000</a>

%e a(10)=9, because 9^2 = 81 = 1010001_2 begins with 1010 = 10_2.

%o (Python)

%o from gmpy2 import isqrt

%o def A272679(n):

%o if n == 0:

%o return 0

%o else:

%o d, nd = 1, n

%o while True:

%o x = isqrt(nd-1)+1

%o if x**2 < nd+d:

%o return int(x)

%o d *= 2

%o nd *= 2 # _Chai Wah Wu_, May 22 2016

%Y Cf. A007088, A018851, A018796, A272680, A272681.

%K nonn,base,easy

%O 0,3

%A _N. J. A. Sloane_, May 22 2016

%E More terms from _Chai Wah Wu_, May 22 2016

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 25 12:27 EDT 2024. Contains 371969 sequences. (Running on oeis4.)