cp's OEIS Frontend

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.

A272681 Smallest binary square that begins with the binary expansion of n.

This page as a plain text file.
%I A272681 #19 May 23 2016 08:06:41
%S A272681 0,1,100,11001,100,1010001,11001,1111001,10000,1001,1010001,101101001,
%T A272681 11001,110111001,11100001,1111001,10000,10001000001,100100,1001110001,
%U A272681 1010001,10101001,101101001,10111110001,110001,11001,1101001001,110111001,11100001,111010001001
%N A272681 Smallest binary square that begins with the binary expansion of n.
%D A272681 Allan C. Wechsler, posting to math-fun mailing list May 22 2016.
%H A272681 Chai Wah Wu, <a href="/A272681/b272681.txt">Table of n, a(n) for n = 0..10000</a>
%e A272681 a(10)=1010001 = 81_10, because 1010001_2 begins with 1010 = 10_2.
%o A272681 (Python)
%o A272681 from gmpy2 import isqrt
%o A272681 def A272681(n):
%o A272681     if n == 0:
%o A272681         return 0
%o A272681     else:
%o A272681         d, nd = 1, n
%o A272681         while True:
%o A272681             x = (isqrt(nd-1)+1)**2
%o A272681             if x < nd+d:
%o A272681                 return int(bin(x)[2:])
%o A272681             d *= 2
%o A272681             nd *= 2 # _Chai Wah Wu_, May 22 2016
%Y A272681 Cf. A007088, A018851, A018796, A272679, A272680.
%K A272681 nonn,base,easy
%O A272681 0,3
%A A272681 _N. J. A. Sloane_, May 22 2016
%E A272681 More terms from _Chai Wah Wu_, May 22 2016